How to display the archive for native posts
The docs you’re looking for are: https://developer.wordpress.org/themes/basics/template-hierarchy/ You need to use home.php or index.php.
The docs you’re looking for are: https://developer.wordpress.org/themes/basics/template-hierarchy/ You need to use home.php or index.php.
Sort Category Archive pages and place sticky posts first
That happens because wp_dropdown_categories, by default, defines the name of the dropdowns as ‘cat’. You are showing 2 dropdowns in the form, and both are named ‘cat’, because you didn’t define a name for them. So when you submit the form, you get two query vars named cat. For example, if you want the second … Read more
WordPress does not support by default custom_fields archive like for taxonomies (yeah, taxonomies can have categories) but we can create a destination page with page template (linked from the listed custom_field) and added a searching on the custom_field, like this (from the listing page): <?php if (get_post_meta($post->ID,’_my_meta’,TRUE)) : $key_meta = get_post_meta($post->ID,’_my_meta’,TRUE); endif; ?> <a href=”https://wordpress.stackexchange.com/questions/92473/<?php … Read more
Using query_posts is pretty much always a bad idea as it causes another database query but it also will break pagination and can cause other issues as well. What you need it a filter on pre_get_posts. function pgp($qry) { if (!is_admin() && is_main_query() && $qry->is_category(3709)) { $qry->set(‘orderby’,’meta_value’); $qry->set(‘meta_key’,’Deadline’); //formatted YYYYMMDD $qry->set(‘ignore_sticky_posts’,true); } return $qry; } … Read more
You can give a try to this within a loop <?php echo $wp_query->found_posts – $wp_query->current_post ; ?> $wp_query->found_posts gives the total number of posts found matching the current query parameters. So the if there are 20 posts, result for each post should look like this For 1st post it will display 20, i.e. 20-0=20 For … Read more
I am clearly an idiot. I was using get_template_part( ‘entry’ ) and I had renamed the entry.php file…
How to have infinite scroll consider passed parameters?
Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
For example, category SPORT is available on /sport and /category/sport. I would like to keep only one. I tried to reproduce that issue and I could confirm it’s true, at least in WordPress v6.0.1 with the default setup, where WordPress is adding a rewrite rule (which is put at the very bottom in the rewrite … Read more