show 4 posts or ajuts in home, show 6 ajuts in search page
This commit is contained in:
parent
a9064949a6
commit
9571fbb5a9
|
@ -58,7 +58,7 @@ get_header();
|
|||
$the_query_ajut = new WP_Query(
|
||||
array(
|
||||
'post_type' => 'ofisuport-ajut',
|
||||
'post_per_page' => '6'
|
||||
'posts_per_page' => '6'
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
<?php
|
||||
// https://developer.wordpress.org/reference/functions/get_posts/
|
||||
// https://www.advancedcustomfields.com/resources/true-false/
|
||||
$the_query = new WP_Query(
|
||||
$featured_query = new WP_Query(
|
||||
array(
|
||||
'post_type' => 'any',
|
||||
'post_per_page' => '4',
|
||||
'post_type' => array( 'post', 'ofisuport-ajut' ),
|
||||
'posts_per_page' => '4',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'os_home_show',
|
||||
|
@ -37,8 +37,8 @@
|
|||
)
|
||||
) );
|
||||
?>
|
||||
<?php if ( $the_query->have_posts() ) : ?>
|
||||
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
|
||||
<?php if ( $featured_query->have_posts() ) : ?>
|
||||
<?php while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
|
||||
|
||||
<?php get_template_part( 'template-parts/section', 'eachpost' ); ?>
|
||||
|
||||
|
|
Loading…
Reference in New Issue