Forums

[resolved] &paged= doesn't work... (4 posts)

  1. k_a_h_n
    Member
    Posted 1 year ago #

    Hi,

    I've searched the forum and found only dead ends, so i'm posting specifically what my problem is.

    I've tried enabling paging on my category.php page:

    <?php
    	global $query_string;
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	query_posts( $query_string . "&contenttype=article&showposts=4&paged=$paged" );
    ?>

    (contenttype is a custom taxonomy BTW)
    For some reason though when I click the 'previous posts' link it gives me a 'Not Found' error from my 404.php page.

    So far i've tried reseting my permalinks back to the default with no success.

    What is strange is that if I try to use the '&paged=' param in the url it sends me to the 404 page. I'm not sure why this is.

    My current theme is the Canvas theme.

    Any suggestions on how to remedy this are greatly appreciated!

    EDIT: Just tried to add &paged=1 and it did work. Anything greater than one gives me the errors i'm describing above.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You don't need to add the paged variab;le if you are simply addding to the existing query.

    Try:

    <?php
    global $query_string;
    query_posts( $query_string . 'contenttype=article&showposts=4' );
    ?>

    or:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts( 'contenttype=article&showposts=4&paged=' . $paged );
    ?>
  3. k_a_h_n
    Member
    Posted 1 year ago #

    Thanks for the tip!
    It doesn't solve my problem though. ):
    It's the presence of the &paged=(>1) in the url that's giving the 404. I'm trying to figure out why that is, and if I can get it to work.

    For example http://mysite.com/?cat=6&paged=1 works fine. But, http://mysite.com/?cat=6&paged=2 gives a 404 error.

  4. k_a_h_n
    Member
    Posted 1 year ago #

    OK, I figured this out. It was the &showposts=4 that was causing problems. I removed that and everything worked fine!

Topic Closed

This topic has been closed to new replies.

About this Topic