Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mailsonmarques89

    (@mailsonmarques89)

    Oh, thanks, one more question. Is any event generated at the end of class that I can capture?

    Thread Starter mailsonmarques89

    (@mailsonmarques89)

    People, thank you for the help. @joy using your logic I made it work as I needed it. Instead of passing set_query_var I just passed the get_template_var and it worked as I needed it.
    The loop made the process of each pass pick up a different model, where the path was in the array.

    	<?php if( $the_query->have_posts() ){ ?>
    		<?php 
    		
    			$i = 0;
    			while ( $the_query->have_posts() ) : $the_query->the_post(); 
    			
    			get_template_part( 'template-parts/content', $cards[$i]['model_card'] );
    		
    			$i++;
    		?>
    
    		<?php endwhile; 
    	} else { ?>
    	
    	<div class="col-12">
    		nothin result
    	</div>
    
        <?php }?>

    @bcworkz Thanks for the explanation, I’ll probably use this function in the future.

    Thread Starter mailsonmarques89

    (@mailsonmarques89)

    First of all thanks for the help. yes, @joy I have files with these names. My site is a news portal, where each card is news. On the home page, each card will assume a number of columns. for example:

    news 1: - 8 columns
    news 2: - 2 columns
    news 3: - 2 columns

    This columns is reference of bootstrap.
    This is the client that selects. So I wanted the latest news to have a different card template. @bcworkz, I did not understand the use of pre_get_posts. Could you explain me, please?

Viewing 3 replies - 1 through 3 (of 3 total)