• Rakesh Raja

    (@rakeshraja)


    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
    https://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)
  • David Gard

    (@duck_boy)

    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
    );
    Thread Starter Rakesh Raja

    (@rakeshraja)

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

    Thread Starter Rakesh Raja

    (@rakeshraja)

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

    Thread Starter Rakesh Raja

    (@rakeshraja)

    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.

    https://pastebin.com/xq5dNL9k

    Thread Starter Rakesh Raja

    (@rakeshraja)

    Please please somebudy reply

    David Gard

    (@duck_boy)

    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
    );
    Thread Starter Rakesh Raja

    (@rakeshraja)

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

    Check the current code

    https://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.