• I run the blog for my company Competition Accessories. Our Blog is Blog.compacc.com. I run the Greyzed theme, but heavily modified. I tweaked every page to show excerpts using the code:

    <div class="entry">
            <?php the_excerpt() ?>
       </div>

    I also added a query code to the templates i made to only show posts from certain categories so he homepage was only newsy related and informative and the motogp, motocross, supercross, etc were in their respective tabs only.
    the code i used for the query is:

    <div class="column">
    	<?php $postcount = "0"; query_posts('category_name=News');// reset post counter ?>
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
              <?php $postcount++; // post counter ?>
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">

    After I made them query only certain categories the Older Posts button failed to work. when i click it it just shows those same 5. that isn’t just on the main page that is every page i used query on.
    Any suggestions. If this has already been posted please link back to it, because i searched for this topic and i may have overlooked it.

    ————–
    EDIT:
    I’ll just post the page script so you can tell me if there is anything that needs to be added or changed…Thank you all in advance

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Try using:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name=Motocross&pages=' . $paged);// reset post counter ?>
    Thread Starter compacc

    (@compacc)

    where in my code should i post that. In the query code or down below the “Find the last page” area

    Thread Starter compacc

    (@compacc)

    I posted query_posts('category_name=News&pages=' . $paged);// reset post counter ?>
    in the code as so:

    <?php
    	// Find page with last post
    	$paged = (get_query_var('news')) ? get_query_var('news') : 1;
            query_posts('category_name=News&pages=' . $paged);// reset post counter ?>
    	$postsppage= get_option('posts_per_page');
    	$total = $paged * $postsppage;
    	$remainder = $total - $wp_query->found_posts;
    	$endvar =  $postsppage - $remainder;
    	?>

    And now this is at the bottom of my Blogs page where the Older Posts Button was:
    $postsppage= get_option(‘posts_per_page’); $total = $paged * $postsppage; $remainder = $total – $wp_query->found_posts; $endvar = $postsppage – $remainder; ?>

    Re-read the code I posted:

    query_posts('category_name=Motocross&pages=' . $paged);// reset post counter ?>

    Thread Starter compacc

    (@compacc)

    Ok i posted it like this

    <div class="column">
    	<?php $postcount = "0"; query_posts('category_name=News&pages=' . $paged);// reset post counter ?>
    	<?php if (have_posts()) : ?>

    Its news instead of motocross because i had the wrong php file opened at first when i made the original then updated it

    with the query that way it still loads the same viewable posts
    do i have to make changes to the code:

    // Find page with last post
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	$postsppage= get_option('posts_per_page');
    	$total = $paged * $postsppage;
    	$remainder = $total - $wp_query->found_posts;
    	$endvar =  $postsppage - $remainder;
    	?>

    Thread Starter compacc

    (@compacc)

    still having issues. I take out the query and the older posts cycle through when i click the previous arrow. Do i need to add another query string down in the navigation section? I really need help asap.

    <div class="column">
    	<?php $postcount = "0"; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name=News&paged=' . $paged);// reset post counter ?>
    	<?php if (have_posts()) : ?>
    Thread Starter compacc

    (@compacc)

    thank you very much

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Older Posts Not Loading. URGENT’ is closed to new replies.