Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Content Views

    (@pt-guy)

    Hello,

    With the lite version, you will need to:
    – create View for each category. If you have 10 categories, you need 10 Views.
    – modify file category.php: replace the WordPress while loop

    which starts with
    while ( have_posts() )
    and ends with
    endwhile;

    by

    <?php echo do_shortcode(“[pt_view id=VIEW_ID]”); ?>

    but you need to check every category to use its relative View, like this:

    if ( is_category( 'test1' ) ) {
    	echo do_shortcode( "[pt_view id=view1]" );
    } else if ( is_category( 'test2' ) ) {
    	echo do_shortcode( "[pt_view id=view2]" );
    } else if ( is_category( 'test3' ) ) {
    	echo do_shortcode( "[pt_view id=view3]" );
    }

    With Pro version at https://www.contentviewspro.com/, only need to create only 1 View, and the modification step is very simple.

    Best regards,

    Thread Starter capri914

    (@capri914)

    Thank you. The problem is that there is no category.php file in my theme (Pro Blogg). I don’t know where I would find that Category file otherwise?

    Plugin Author Content Views

    (@pt-guy)

    If so, you should modify file archive.php (if exists) or index.php

    Hey there. Where does one paste the second box of code? (the one with if ( is_category)). Thanks

    Plugin Author Content Views

    (@pt-guy)

    Please put it in file category.php of your theme.
    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to get grid layout in categories?’ is closed to new replies.