WordPress Show 4 posts from 4 specific categories in a slider
WordPress Show 4 posts from 4 specific categories in a slider
WordPress Show 4 posts from 4 specific categories in a slider
Filtering product search results using tags
Go into Admin, Settings, Permalinks, and change whatever is there to another choice. Save the setting. Then go back and change it to what you want it to be. Save the setting. Then try going to a page on your site. Also, check that your htaccess file has the basic WordPress settings. See here: https://wordpress.org/support/article/htaccess/
WP_Query – order with usort by custom meta
Get comment number by date range?
how do I include those posts that don’t have an entry? You can include those posts (which do not have the expire_date field/meta) by adding a second clause with ‘compare’ => ‘NOT EXISTS’, and then set the relation to OR: $query_args[‘meta_query’] = array( // the relation between the root clauses/queries; defaults to AND ‘relation’ => … Read more
You have to turn off sql_mode=only_full_group_by on your server via an SQL command e.g. https://stackoverflow.com/a/36568545/57482
pre_get_posts filters run before WordPress has figured out the main query, which is used to pick the template. For this reason you can’t put it inside the template, it has to run before the template is picked, not afterwards. For this reason, it has to go inside your themes function.php or in a plugin
If I understood you correctly, you are looking for get_the_terms(), which.. Retrieves the terms of the taxonomy that are attached to the post. You could for example have helper functions like these, // functions.php function my_sports_post_terms( int $post_id ) : array { $taxonomies = [‘basketball’, ‘volleyball’, ‘baseball’]; $terms = []; foreach ($taxonomies as $taxonomy) { … Read more
I found a solution to my question. I used the following code: global $wpdb; if($t_query->have_posts()){ while($t_query->have_posts()){ $t_query->the_post(); echo $wpdb->last_query.”\r\n”; } } and it showed there was an action somewhere hooked to the_post hook, sending requests to update some meta every time a post was processed. So, the answer to my question is: I should have … Read more