Support » Fixing WordPress » Paged url rewrite causing 404

  • My issue is when pagination on my sermons page is url-rewritten, the written url is not valid and produces a 404 error. All I need to happen is for the ‘paged’ parameter to make it to that sermons page, so the “loop” in that page can handle it.

    this is the beginning of the loop for that page:

        $paged = get_query_var('paged') ? get_query_var('paged') : 1;
        $args = array( 'post_type' => 'sermon', 'posts_per_page' => get_option('posts_per_page'), 'paged' => $paged );
        $loop = new WP_Query( $args );
        while ( $loop->have_posts() ): $loop->the_post(); ?>

    For background, this is a regular WordPress page using a template, the purpose of the page is to loop through all of the ‘sermon’ posts and display them (paginated). This could have maybe been done with an archive page, but I didn’t design the theme so I have to work with what I have, I think.

    I don’t want to create my own archive page because it would interfere with other functionality in the theme, if possible.

    Here is the webpage:

    • This topic was modified 6 years, 1 month ago by jpurdy647. Reason: add page link
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Paged url rewrite causing 404’ is closed to new replies.