Best practice for linking to posts and images within a post (2 posts)

  1. Ian Dunn
    Posted 9 years ago #

    Is there a good way to link to other posts on your site and images that are inside a theme from inside a post/page?

    I know I could use the URL (http://www.somesite.com/?p=3 or http://www.somesite.com/wp-content/themes/foo/images/bar.jpg) but that would break everything I moved WordPress to a different directory or domain, which I plan on doing.

    I could also installed PHPEXEC or a similar plugin and then use bloginfo('template_url') and bloginfo('url') but for this site there will be several editors who will need to edit these pages and it wouldn't be a good idea for them to have the ability to enter php code.

    Is there a way to use template tags in posts or something similar?

  2. KatGirl
    Posted 9 years ago #

    Why not invent a new folder or folders on your server purely for this reason?

    I have a separate folder called: Images (Woohoo) that remains outside of the wordpress system, but on my server, and I upload all my images to there, because should I wish to move my site from its current directory the absolute last thing I want to do is open each and every post I've referenced to images and change the url. Plus, on a purely vanity point, I didn't like the over-long reference to images:

    ie: mysite.com/wp-content/themes/mythemename/images/imagename.jpg

    now it read: mysite.com/images/imagename.jpg

    You can create sub-folders within this new folder on your server for each editor, or sub-section ie: clippings and then upload the info as you go.

    Just a thought

Topic Closed

This topic has been closed to new replies.

About this Topic