Support » Fixing WordPress » Properly linking an image from sidebar

  • I’m working on building a new site on a server that hasn’t had the DNS nameservers pointed to yet. I’m testing/using the admin panel through the IP address.

    I’m trying to add an image to the sidebar. I added a text widget to it and tried:

    – Putting the path dynamically with PHP. This didn’t work because this won’t process PHP
    – putting the relative path: wp-content/themes/physmed/images/image.jpg, but this only works on the homepage. On other pages and posts the link breaks because it is on a different subfolder.
    – Putting an absolute path. But when my client changes the nameservers, I’ll have to go back and change the paths again. Something I don’t want to have to explain to the client.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to associate the IP of the new website along with its URL in the hosts file on your computer. This will enable you to view the new website over its domain.

    For the image, you should be using the full URL instead of a path. Ideally you would do this via modifying the Theme’s sidebar code or via a plugin that takes care of generating the right code.

    Thank you. I used the image widget plugin. It was great

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Properly linking an image from sidebar’ is closed to new replies.