• ok, i am going to keep this short and to the point. My custom theme, StarLight, is currently running with permalinks set to /%postname%/. The pagination for my wordpress posts works perfectly with this permalink but the pagination breaks apart on my custom post types.

    You can see the pagination working here (default wordpress posts):
    http://wp.pulsarmedia.ca/starlight/news/

    And the pagination not working here (custom post type):
    http://wp.pulsarmedia.ca/starlight/articles/

    Can anyone answer why my pagination doesn’t work on custom post types?

Viewing 10 replies - 1 through 10 (of 10 total)
  • can i see your query code for custom post type
    use pastebin for long code

    Thread Starter Pulsar_Media

    (@pulsar_media)

    Not familiar with pastebin but im guessing you wanted me to paste my code on http://pastebin.com/1PF2z88W ?

    Please confirm that link works and you can see my code.

    Thanks.

    you have posted your custom post type registeration code i need to see your loop for custom post type which you are using with query_posts

    Thread Starter Pulsar_Media

    (@pulsar_media)

    ok, here is the new link http://pastebin.com/jVYijVFC

    I should mention that i am using two methods defined in my functions.php file to query wordpress posts which I’ve included in pastebin so you can see it.

    Take a look at my code and let me know if everything makes sense.

    Thanks.

    try this ‘paged’ => get_query_var(‘paged’) in place of ‘paged’ => $paged
    and comment line //global $paged;

    Thread Starter Pulsar_Media

    (@pulsar_media)

    ok i tried that but doesnt seem to work, here is the updated code block:

    <?php
    //global $paged;

    $arguments = array(
    ‘post_type’ => ‘post_articles’,
    ‘post_status’ => ‘publish’,
    ‘paged’ => get_query_var(‘paged’)
    );

    $wp_query = new WP_Query($arguments);

    pm_set_query($wp_query);

    ?>

    try changing your query code
    <?php
    query_posts(array(‘post_type’=>’post_articles’,’post_status’=>’publish’,’paged’=>get_query_var(‘paged’)));
    if(have_posts()):while(have_posts()):the_post();
    //your content, title or whichever you want to show
    endwhile; endif;
    //you pagination code
    wp_reset_query();
    ?>

    Thread Starter Pulsar_Media

    (@pulsar_media)

    yea i tried that already…while spending several hours looking for answers to this fiasco online.

    I updated my code anyways and you can see it still doesn’t work http://wp.pulsarmedia.ca/starlight/articles/

    sorry pulsary_media for not helping you but one more time you can try with
    ‘posts_per_page’=>’2’

    Thread Starter Pulsar_Media

    (@pulsar_media)

    hey no problem, i tried that also but it didn’t work. Everything works fine if i leave the permalinks set to default so i guess i will just leave it for now.

    if you think of any other ideas let me know, appreciate the help :]

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Pagination not working with custom post type’ is closed to new replies.