WordPress.org

Ready to get started?Download WordPress

Forums

Show all posts in a portfolio category (2 posts)

  1. notoire
    Member
    Posted 1 year ago #

    Hi there,

    I'm having problems with some php codes. The only thing I want is to show all posts from a specific portfolio category. But right now it's only showing 10 posts (1 page). This is the code I'm using right now in 'taxonomy-portfolio-category.php'.

    <?php 	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    						$paged = (get_query_var('paged')) ? get_query_var('paged') : 0;
    
    						query_posts( array(
    								'post_type' => 'portfolio',
    								'portfolio-category' => $term->slug,
    								'paged' => $paged,
    								'orderby' => 'menu_order',
    								'order' => 'ASC'
    								)
    						);
    
    					if( have_posts() ) :  while (have_posts() ): the_post(); 
    
    						$portfolio_terms = get_the_terms( get_the_ID(), 'portfolio-category' );
    							$portfolio_term = '';
    								if(is_array($portfolio_terms)){
    									foreach($portfolio_terms as $term){
    											$portfolio_term.= $term->slug.' ';
    									}
    								}
    				 ?>

    What should I change to load all posts from a specific portfolio category.

    Thank you in advance,

    Nathan Lewis

  2. notoire
    Member
    Posted 1 year ago #

    Solution: add 'posts_per_page' => 10000 in the array.

Topic Closed

This topic has been closed to new replies.

About this Topic