Not nearly enough information but odds are, in what ever file is being used for your home page or possibly your theme’s functions.php there’s a query. That query uses variables for the order and orderby : https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters and most likely it contains something like:
'order' => 'DESC',
'orderby' => 'date'
...
and a simple way to accomplish what your asking is to change the orderby to rand
Thread Starter
adr10
(@adr10)
I tried to put only that nothing changes, could you see if it is correct?
<!-- NORMAL PROFILES start -->
<div class="bodybox bodybox-homepage">
<h3 class="l"><?php printf(esc_html__('Newly Added %s','wp'),ucwords($taxonomy_profile_name_plural)); ?></h3>
<div class="clear"></div>
<?php
$args = array(
'post_type' => $taxonomy_profile_url,
'meta_query' => array( array('key' => 'premium', 'value' => '0', 'compare' => '=', 'type' => 'NUMERIC') ),
'posts_per_page' => get_option("frontpageshownormalcols") * 5
'orderby' => 'rand',
);
$normal_profiles = new WP_Query( $args );
$i = "1";
if ($normal_profiles->have_posts()) :
while ( $normal_profiles->have_posts() ) : $normal_profiles->the_post();
include (get_template_directory() . '/loop-show-profile.php');
endwhile;
else:
printf(esc_html__('No %s here yet','wp'),$taxonomy_profile_name_plural);
endif;
wp_reset_postdata();
?>
<div class="clear"></div>
<
<!-- NORMAL PROFILES end -->
<?php } // if $frontpageshownormal = 1 ?>
<?php if (get_option("frontpageshowrev") == 1) { ?>
<?php
$args = array(
'post_type' => 'review',
'posts_per_page' => get_option("frontpageshowrevitems"),
'orderby' => 'rand',
);
$reviews_query = new WP_Query( $args );
if ( $reviews_query->have_posts() ) :
?>
-
This reply was modified 5 years, 11 months ago by
Yui. Reason: please use CODE button for proper formatting
Hard to tell right off but you seem to be missing a comma at the end of:
'posts_per_page' => get_option("frontpageshownormalcols") * 5
Are you getting any errors at all because of that?
Are you using a free them by chance?
-
This reply was modified 6 years, 1 month ago by
tugbucket.
Thread Starter
adr10
(@adr10)
I tried adding the comma but nothing happened. I’m not having any problems, I bought the theme, it’s not from chance
Do you have a link to your page in question. The query looks fine but might be something else.