WordPress.org

Ready to get started?Download WordPress

Forums

Want to make a template for the "previous posts" pages (6 posts)

  1. dariel
    Member
    Posted 3 years ago #

    Hello out there. Here's my site: http://www.dariel.com/log. I have a special header on my blog index page that goes away when you click on an individual post. I'd like the "previous posts" pages to look the same as the individual post pages. Right now, they are calling the special header from the index page rather than the plain header on the single.php page. This leads to a --gasp-- broken link! I am using the Mullenweg rotate.php on the special header, so the image link is broken on the "previous posts" page. This seems like it should be easy to fix, but I can't find anything in the forums specific enough to help. Thank you.

  2. futurepocket
    Member
    Posted 3 years ago #

    I don't understand what you are trying to do. You want to add the rotate.php script to all your pages/posts not only on the index so the rotating images display on all your posts? Where is the "previous posts" pages, I don't see any link to that on your website?

  3. dariel
    Member
    Posted 3 years ago #

    Um, well, that could work. My original idea was to use a more plain header without the rotate.php script in it. Here is a direct link to the "previous posts" page (it's way down at the end): http://www.dariel.com/log/page/2/

  4. futurepocket
    Member
    Posted 3 years ago #

    The script is trying pull off the wrong location, just add a forward slash to wp-content... like this:

    /wp-content/themes/dariel-EmptyCanvas/images/random/rotate.php

    instead of:

    wp-content/themes/dariel-EmptyCanvas/images/random/rotate.php

    That should fix it.

  5. dariel
    Member
    Posted 3 years ago #

    Nope, that just breaks my main page, which was working already. What I really need, I think, is a better way to identify the pagination, so that the correct header is called. That, or a template for the older posts page. I guess I could just make one and link to it.

  6. dariel
    Member
    Posted 3 years ago #

    Wow. I fixed it. It's been, like, months.
    Ok. So here's what worked:

    <?php
    if ( is_home() and !is_paged()) :
      get_header('home');
    else :
      get_header();
    endif;
    ?>

    Which is weird because it seems to say the opposite of what it does. Here's what I had before that didn't work:

    <?php
    if ( is_home()) :
      get_header('home');
    else :
      get_header();
    endif;
    ?>

    Strange.

Topic Closed

This topic has been closed to new replies.

About this Topic