Support » Fixing WordPress » Pagination for Custom post type

  • I have quite complex loop..

    I am using custom post type with custom loop and taxnomies..

    I am displaying posts of custom post type.. listing by main taxonomy and sub taxonomy.

    Following is code
    http://pastebin.com/gpbW1dVS

    I have checked several posts here for the solution but none worked.. Please help.

    Regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • You need to add posts_per_page and paged to your query

    $wpq = array (
        'posts_per_page' => get_option('posts_per_page'),
        'paged' => $paged,
        'taxonomy' => $taxonomy,
        'term' => $termsub->slug
    );

    I did that too but still not worked but let me try again

    It will be great if you can paste it in my code and show me .. so no mess up

    I tried it did nothing…

    Please check my dev. site..

    I want to make pagination for this page.. top bigger font is main taxonomy, and each box is sub taxnomy.. and data in tables are posts.

    I did the changed in my code and here it is .. check and let me know whats wrong.

    http://pastebin.com/xq5dNL9k

    Please please somebudy reply

    Can’t be 100% as not sure exactly what you want to achieve, but this should hopefully point you in the right direction.

    $tax_query = array(
    	array(
    		'taxonomy' => 'your-taxonomy'
    		'field' => 'id' // Can also use 'slug'
    		'terms' => array(
    			20, 30, 40
    		)
    	)
    	array(
    		'taxonomy' => 'another-taxonomy'
    		'field' => 'slug' // Can also use 'slug'
    		'terms' => array(
    			term-1,
    			term-2,
    			term-3
    		)
    	)
    )
    $wpq = array (
            'paged' => $paged,
            'posts_per_page' => get_option('posts_per_page'),
            'post_type' = array('your-post-type'),
            'tax_query' => $tax_query
    );

    Anyways I have done most of the things but still one problem mate

    Check the current code

    http://pastebin.com/7NKbYEGU

    Check the current page with problem

    Demo site

    regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Pagination for Custom post type’ is closed to new replies.