Title: Read More Problem
Last modified: August 19, 2016

---

# Read More Problem

 *  Resolved [doppyo](https://wordpress.org/support/users/doppyo/)
 * (@doppyo)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/)
 * I’m running the latest version of wordpress(2.7) and I customized the Read More
   link to be an image. From there, everything’s fine. I’m testing my website locally
   before uploading it to my server, so the path to the image is like this:
 * `<?php the_content('<img src="http://localhost/wordpress-2.7/wordpress/wp-content/
   themes/default/images/readmore_big.gif" class="alignright">'); ?>`
 * Naturally, when I upload it, links are broken if I try to access my website from
   any computer but my own, since the images are there.
    I don’t want to manually
   change every read more link to the path of the server everytime like : `*http://*
   mywebsite.com*/wp-content/themes/default/images/readmore_big.gif`
 * I did read the codex post about customizing the readmore but if I use `<img src
   ="/images/readmore_big.gif">` images won’t show up.
 * I tried to put bloginfo(‘stylesheet_directory’) in a variable to place into the
   src property but then I got no image and only the path of the directory printed
   instead of the readmore button.
 *     ```
       <?php $path = bloginfo('stylesheet_directory');
       the_content('<img src="' . $path . '/images/readmore_big.gif"
       class="alignright">'); ?>
       ```
   
 * other try:
    `<?php the_content('<img src="<?php bloginfo('stylesheet_directory');?
   >/images/readmore_big.gif" class="alignright">'); ?>` None worked.
 * Is there a way to put a variable in the path to the image(or any other way possible)
   so I won’t have to manually change the path everytime I upload to my server? 
   I also tried the CSS way but haven’t worked either.
 * Thanks in advance for any responses and sorry for my not-so-good english.

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977632)
 * According to [http://codex.wordpress.org/Template_Tags/bloginfo](http://codex.wordpress.org/Template_Tags/bloginfo)
   stylesheet_directory is deprecated.
 * Try template_directory, see if it works for you.
    Or try `<?php include (TEMPLATEPATH.'/
   images/readmore_big.gif'); ?>`
 *  Thread Starter [doppyo](https://wordpress.org/support/users/doppyo/)
 * (@doppyo)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977639)
 * Thanks a lot for the information, I did replace stylesheet_directory with template_directory
   in my files. I tried :
 *     ```
       <?php $path = bloginfo('template_directory');
       the_content('<img src="' . $path . '/images/readmore_big.gif"
       class="alignright">'); ?>
       ```
   
 * But it did not work either, unfortunately. I did try your second suggestion but
   I fear that I haven’t put it properly into the code. I’m quite only an amateur
   when it comes to php. Here’s what I did with your second suggestion :
 * `<?php the_content('<img src="<?php include (TEMPLATEPATH . \'/images/readmore_big.
   gif\'); ?>" class="alignright">'); ?>`
 * Didn’t work either, many thanks for your info though. Is it even possible to 
   do what I want to do?
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977642)
 * I think it should be possible to do it, it’s just a matter of finding the right
   code.
 * You have backslashes here `\'/images/readmore_big.gif\`, is perhaps this not 
   making it work?
 * Also, instead of
 *     ```
       <?php $path = bloginfo('template_directory');
       the_content('<img src="' . $path . '/images/readmore_big.gif"
       class="alignright">'); ?>
       ```
   
 * try
 * `<?php the_content('<img src="<?php bloginfo('template_directory'); ?>/images/
   readmore_big.gif" class="alignright" />'); ?>`
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977645)
 * OK, I just looked some old files I had…
 * 1 – Try template_url instead of template_directory
 * 2 – I tried to edit the code above, but it wouldn’t let me add a slash…. before
   the very closing of the img tag, there is a missing slash
 * `<?php the_content('<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.
   gif" class="alignright" />'); ?>`
 * `<img src="<?php bloginfo('template_url'); ?>//images/readmore_big.gif" class
   ="alignright" />`
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977646)
 * I added an edit to the above post, and it was eaten away….
 * here it goes again…
 * CORRECTION – I looked into some other files I had
    try template_url, instead 
   of template_directory
 * Also, there is a closing slash missing in the image tag
 * `<?php the_content('<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.
   gif" class="alignright" />'); ?>`
 * or simply
 * `<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.gif" class="
   alignright" />`
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977647)
 * I added an edit to the above post, and it was eaten away….
 * here it goes again…
 * CORRECTION – I looked into some other files I had
    try `template_url`, instead
   of `template_directory`
 * Also, there is a closing slash missing in the image tag
 * `<?php the_content('<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.
   gif" class="alignright" />'); ?>`
 * or simply
 * `<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.gif" class="
   alignright" />`
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977648)
 * I added an edit to the above post, and it was eaten away….
 * here it goes again…
 * **CORRECTION** – I looked into some other files I had
    try `template_url`, instead
   of `template_directory`
 * Also, there is a closing slash missing in the image tag
 * `<?php the_content('<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.
   gif" class="alignright" />'); ?>`
 * or simply
 * `<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.gif" class="
   alignright" />`
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977649)
 * For some reason the correction I am trying to post gets eaten away…
 * let me just explain… I looked into some other files that I had and the reference
   was to template_url, rather than template_directory
 * Try that
 * Also, note that there was a missing closing slash in the img tag, so I added 
   it in the last code posted, after alignright.
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977650)
 * test post, as anything I add here gets eaten away and doesn’t post…
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977652)
 * I added an edit to the above post, and it was eaten away….
 * here it goes again…
 * CORRECTION – I looked into some other files I had
    try `template_url`, instead
   of `template_directory`
 * Also, there is a closing slash missing in the image tag
 * `<?php the_content('<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.
   gif" class="alignright" />'); ?>`
 * or simply
 * `<img src="<?php bloginfo('template_url'); ?>/images/readmore_big.gif" class="
   alignright" />`
 * See if this works for you!
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977653)
 * Sorry for all the duplicate posts, they weren’t posting earlier, now they are
   all appearing… mods, please delete
 *  Thread Starter [doppyo](https://wordpress.org/support/users/doppyo/)
 * (@doppyo)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977708)
 * Thanks for all the support buddha trance. I finally found(absolutely randomly)
   the way to get all this working. The problem was the function bloginfo(). I tried
   to do the same with _get\_bloginfo()_ and voilà, everything’s working perfectly.
 * Here’s the code I put in header.php so I don’t have to type this ever again:
 *     ```
       <?php global $path;
       $path = get_bloginfo('template_url');
       ?>
       ```
   
 * and the code I put into the_content():
 * `<?php the_content('<img src="'.$path.'/images/readmore_big.gif" class="alignright"/
   >'); ?>`
 * Thanks again for helping me out!
    Ben.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Read More Problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 2 participants
 * Last reply from: [doppyo](https://wordpress.org/support/users/doppyo/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/read-more-problem/#post-977708)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
