Support » Fixing WordPress » Permalinks – "Page Not Found"

  • Hi all,

    I am having an issue where I cannot navigate to older posts on my blog, unless I use the defult style of permalinks.

    The site: http://www.notyouraveragelawyer.com

    Posts display fine up until page 4 when my own “posts not found” message appears. When using standard permalinks, this does not happen. It is only when I try to edit the permalink structure to a ‘pretty permalink’ structure that the posts cannot be displayed.

    My .htaccess is configured as follows

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Which I believe is correct.

    The issue does not seem to occur with the basic wordpress theme.

    Does anybody know a) how I can resolve this issue, and b)Which area I could troubleshoot within my themes files in order to try and find the issue.

    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Forum Moderator

    Does your theme’s index.php template file use a custom query ( query_posts() )?

    Yes Esmi it does,

    See below:

    if (is_paged()) :
    				query_posts($use_category ."showposts=".get_option("ocmx_home_page_posts")."&paged=".get_query_var('paged'));
    			elseif (is_home()) :
    				query_posts($use_category."showposts=".get_option("ocmx_home_page_posts"));
    			endif;
    
    			if (have_posts()) :
    				while (have_posts()) :	the_post();
    					setup_postdata($post);
                        // Fetch the PermaLink, Thumbnail and Video Metas
                        $get_post_video = get_post_meta($post->ID, "main_video", true);
                        $get_thumbnail = get_post_meta($post->ID, "other_media", true);
                        $link = get_permalink($post->ID);

    etc…

    Would the is_paged() option be to do with the issue?

    esmi

    (@esmi)

    Forum Moderator

    Possibly… Try replacing:

    if (is_paged()) :
    				query_posts($use_category ."showposts=".get_option("ocmx_home_page_posts")."&paged=".get_query_var('paged'));
    			elseif (is_home()) :
    				query_posts($use_category."showposts=".get_option("ocmx_home_page_posts"));
    			endif;

    with:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($use_category . 'posts_per_page=' . get_option('ocmx_home_page_posts') . '&paged=' .$paged );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Permalinks – "Page Not Found"’ is closed to new replies.