Forums

blogstyle.php Question (6 posts)

  1. jderosa3
    Member
    Posted 3 years ago #

    I am creating a site using WordPress and I am using a theme that I am modifying... I have found through trial and error that the blogstyle.php file allowed me to edit it so that I could put a custom header on my blog post page.

    Basically all I put was a graphic header with some text below then the posts come after this...

    Works perfect... but I have the posts page paginate so once it hits 10 posts you can go to the next page to view more posts...

    Now when you do this... my header is still in place, but the graphic does not display... it shows a little blue rectangle with a question mark in it (Safari) as if it cannot find the image... it's odd because I coded the img src as both:

    ../images/post-header.png
    http://www.xxxx.com/images/post-header.com

    both on only work the the first page... but when you go to the 2nd page or further the images does not show... odd because the text still displays... meaning that it still is pulling the copy from the edited part of the blogstyle.php file....

    Any ideas here? Is there a plug in that will allow me to edit the post page... thanks for any guidance...

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    I have no idea what theme you're using but you could try referencing the image using:

    <?php bloginfo('template_directory'); ?>/images/post-header.png

    and see if that works.

  3. jderosa3
    Member
    Posted 3 years ago #

    I will try that... I actually put the images folder in the root of my domain directory... I put all my custom images there... but I guess that is bad practice and should move them to the theme images folder... and try what you said above...

    I will try and see what comes about... thanks for the tip...

  4. jderosa3
    Member
    Posted 3 years ago #

    no go with this:

    <img src="<?php bloginfo('redtable'); ?>/images/rtd-header.png" width="642" height="286" alt="Round Table Discussion" />

    this was my code before:
    <img src="../images/rtd-header.png" width="642" height="286" alt="Round Table Discussion" />

    it works still but not on the second page and beyond...

  5. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Not quite what I meant. Try using the code below. Don't make any changes. WP will parse <?php bloginfo('template_directory'); ?> and should return the correct path to your theme's image directory.

    <img src=<?php bloginfo('template_directory'); ?>/images/rtd-header.png" width="642" height="286" alt="Round Table Discussion" />

  6. jderosa3
    Member
    Posted 3 years ago #

    Genius! Thanks... worked like a charm! Thank you kindly.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.