Step 1: Define variables.
Let distance from home to office $= D$ km.
Let driving speed $= v$, so walking speed $= v/8$ (since walking takes 8 times longer).
Step 2: Walking and driving times.
- Time to drive $D$ km $= D/v$.
- Time to walk $D$ km $= 8D/v$.
Step 3: Analyze the two alternatives at the temple.
At the temple, distance covered $=1$ km (walking). Distance remaining to office $= D-1$.
\underline{Case 1: Continue walking to office.}
Time $= \dfrac{D-1}{v/8} = \dfrac{8(D-1)}{v}$.
\underline{Case 2: Return home (1 km back) and drive to office.}
- Walking back $1$ km: time $= \dfrac{1}{v/8} = \dfrac{8}{v}$.
- Driving $D$ km: time $= D/v$.
Total time $= \dfrac{8}{v} + \dfrac{D}{v} = \dfrac{D+8}{v}$.
Step 4: Equating times (given condition).
\[
\frac{8(D-1)}{v} = \frac{D+8}{v}
\]
\[
8D - 8 = D + 8
\]
\[
7D = 16 \;\;\Rightarrow\;\; D = \frac{16}{7}.
\]
Step 5: Distance from temple to office.
Temple is $1$ km from home, so remaining distance $= D - 1 = \frac{16}{7} - 1 = \frac{9}{7}\ \text{km}.
\]
\[
\boxed{\tfrac{9}{7}\ \text{km}}
\]