Limit categories to 6 on the page
-
I have this archive page, that now we want to only show 6 of the categories on the page. I have tried a few different things, but none of them changed anything. Where should I add something to limit the number shown to 6?
<?php ?> <div class="series_archive"> <hr> <h2>Series Archive:</h2> <div class="row"> <?php $categories = get_categories( array( 'parent' => 40 //sermons category ) ); //$currCatTitle = single_cat_title("", false); $currCat = get_queried_object()->cat_ID; foreach ( $categories as $category ) { if ( $currCat != $category->cat_ID ) { //don't show current category again echo sprintf( '<div class="col-sm-4"><a href="%s">%s</a></div>', esc_url( get_category_link( $category->term_id ) ), do_shortcode( sprintf( '[wp_custom_image_category term_id="%s"]', $category->term_id ) ) ); } } ?> </div> <div style="clear:both;margin-bottom:24px;"></div> <span class="pastSermons"><a href="https://vimeo.com/gracechico" target="_blank">Archived Sermons</a></span> </div> </div>
`
The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Limit categories to 6 on the page’ is closed to new replies.