+ Reply to Thread
Results 1 to 4 of 4

Thread: Adding 'Older posts' to Hybrid News

  1. #1
    Ipstenu's Avatar
    Ipstenu is offline Big Tipper
    Join Date
    Feb 2010
    Posts
    303

    Icon3 Adding 'Older posts' to Hybrid News

    FYI, I tried to send this as a comment but it hung. Dunno why.

    I saw your twitter comments and, as a user of the same theme, I can tell you that it's not too hard to add in refs to older posts to your front-page. The trick is that you can only link to 'older posts by category' since, as Justin mentioned, the front-page doesn't paginate. At all.

    To get an idea of the wacky I've done, go to http://jorjafox.net

    Now on that page, yes, it's a splash with the 5 most recent posts in rotation, and a bit about the site with 'cool features'. (and needs a better 'More News' link below the slider, but I've been slacking). The front-page.php has had the bottom part stripped and replaced with 'What this site offers'. I don't believe in above/below the fold, but I do think that the first thing people should see needs to pull them in. In my case, information about my subject

    I took the bottom half (excerpts etc) and moved it to a new template I called news.php to make the NEXT page: http://jorjafox.net/news

    Now that has, below each section, a simple 'Older Posts' link.

    Here's the basic code I tweaked on the News page:

    For the excerpts section, find:
    Code:
        <?php endwhile; wp_reset_query(); ?>
    
    And replace with:
    Code:
            <?php endwhile;
        $cat_excerpt = $news_settings['excerpt_category'];
        $category_link = get_category_link( $cat_excerpt );
        ?>
        <p><a href="<?php echo $category_link; ?>page/2/" title="<?php echo $cat_excerpt->name; ?>">&laquo; Older Posts</a></p>
        <?php wp_reset_query(); ?>
    
    For the headlines section, find:
    Code:
    <ul>
        <?php foreach($headlines as $post) : $do_not_duplicate[] = $post->ID; ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
        <?php endforeach; ?>
    </ul>
    
    And replace with:
    Code:
    <ul>
        <?php foreach($headlines as $post) : $do_not_duplicate[] = $post->ID; ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
        <?php endforeach; ?>
        <li><br /><a href="<? echo get_category_link($category); ?>page/2" title="<?php echo $cat->name; ?>">&laquo; Older Posts</a></li>
    </ul>
    
    Now, all that said, you can see I'm pointing to the category's page 2. You could probably make a 'latest posts' template (rip the standard hybrid one, for example) and link to that to see older posts. In my case, I find people want to read more about the subject by category, but I've got a lot of years of metrics. It's an audience based tweak, that one.

    Still, it's a starting point for you to kick around Hope it helps some! If you need a hand, I'm happy to help out.

    The code's also up here: http://wordpress.pastebin.com/3pxvBHD1

  2. #2
    andrea_r's Avatar
    andrea_r is offline WPTavern Forum Moderator
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,279

    Default

    Was this meant to be a PM? :)

  3. #3
    Jeffro's Avatar
    Jeffro is offline WPTavern Forum Admin
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    2,107

    Default

    Thanks for the tips but I've been keeping an eye out for other themes that provide a featured content box while having a blog layout. I can control excerpt presentation via a plugin so no worries about that. I wish PigNews would be released already but it's got a ways to go yet.

  4. #4
    Ipstenu's Avatar
    Ipstenu is offline Big Tipper
    Join Date
    Feb 2010
    Posts
    303

    Default

    Nah, I meant to post. Actually I tried the contact form but it ate and then I said, you know, I bet other people use this too!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts