show 4 posts or ajuts in home, show 6 ajuts in search page

This commit is contained in:
jorge-vitrubio 2023-01-28 12:56:12 +01:00
parent a9064949a6
commit 9571fbb5a9
2 changed files with 6 additions and 6 deletions

View File

@ -58,7 +58,7 @@ get_header();
$the_query_ajut = new WP_Query( $the_query_ajut = new WP_Query(
array( array(
'post_type' => 'ofisuport-ajut', 'post_type' => 'ofisuport-ajut',
'post_per_page' => '6' 'posts_per_page' => '6'
) )
); );
?> ?>

View File

@ -25,10 +25,10 @@
<?php <?php
// https://developer.wordpress.org/reference/functions/get_posts/ // https://developer.wordpress.org/reference/functions/get_posts/
// https://www.advancedcustomfields.com/resources/true-false/ // https://www.advancedcustomfields.com/resources/true-false/
$the_query = new WP_Query( $featured_query = new WP_Query(
array( array(
'post_type' => 'any', 'post_type' => array( 'post', 'ofisuport-ajut' ),
'post_per_page' => '4', 'posts_per_page' => '4',
'meta_query' => array( 'meta_query' => array(
array( array(
'key' => 'os_home_show', 'key' => 'os_home_show',
@ -37,8 +37,8 @@
) )
) ); ) );
?> ?>
<?php if ( $the_query->have_posts() ) : ?> <?php if ( $featured_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachpost' ); ?> <?php get_template_part( 'template-parts/section', 'eachpost' ); ?>