Support » Fixing WordPress » Pages loose template images

  • Resolved thehowellsnest

    (@thehowellsnest)


    Hello,

    For some reason on my site if i got to a page all the images get the path /public_html/page/wp-content/themes/howellsnest/images/name.gif but if i view it from the homepage it works fine.

    anyone got any ideas?
    Rich

Viewing 9 replies - 1 through 9 (of 9 total)
  • esmi

    (@esmi)

    Forum Moderator

    Site url?

    http://www.thehowellsnest.com if you go to the bottom and click older posts it happens, if you click a page from the menu it does it.

    Rich

    esmi

    (@esmi)

    Forum Moderator

    Which images are you referring to? I couldn’t find any with that path in them – although I did notice that you have a single space in your theme name (howells nest) which really needs to be removed.

    Okay, i have had a look and it still happens. If you look at this image (http://localhostr.com/files/3fe624/thnerror.JPG) the top shows the homepage and the lower section shows the page after i clicked the older stories link (http://www.thehowellsnest.com/page/2) as you can see the areas marked in red have images missing, on Rich News on the left their should be a image with the path (http://www.thehowellsnest.com/wp-content/themes/howells%20nest/images/richardthumb.gif) but when i click the older stories link it changes it to http://www.thehowellsnest.com/page/wp-content/themes/howells%20nest/images/richardthumb.gif

    Also i will remove the single space in the theme name i hope this wont break anything. Will more than likely need some hard code changing.

    Hope this isnt too confusing.
    Rich

    esmi

    (@esmi)

    Forum Moderator

    Looks like either your theme or a plugin that you’re using to display featured content (or both) is broken. When a featured image is added to the page, it’s being inserted with a relative path. When images are being added to the inline style, the link is to images folder in the theme instead of the post attachment image.

    Are the featured posts part of your theme or a plugin?

    By featured posts do u mean the content down the left hand side?

    I think i have found the problem, i have the following code

    <h2>Rich News</h2>
    
    					<?php $temp_query = $wp_query; ?>
    					<?php query_posts('cat=6&showposts=2'); ?>
    					<?php while (have_posts()) : the_post(); ?>
    					<a href="<?php the_permalink() ?>"><img src="wp-content/themes/howellsnest/images/richardthumb.gif" width="86" height="88" alt="" /></a>

    I dont know why this is a permalink can it be changed do you think?

    esmi

    (@esmi)

    Forum Moderator

    Try changing it to:

    <h2>Rich News</h2>
    <?php $temp_query = $wp_query; ?>
    <?php query_posts('cat=6&showposts=2'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink() ?>"><img src="<?php bloginfo('template_directory'); ?>/images/richardthumb.gif" width="86" height="88" alt="" /></a>

    which takes out the hardcoded relative image location. WP doesn’t handle relative links very well.

    the_permalink is fine. It just points to a featured post. You could just remove the entire link if you want to.

    That seems to have fixed it 🙂 Brilliant 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Pages loose template images’ is closed to new replies.