How to get a terms and posts associated with another term?
How to get a terms and posts associated with another term?
How to get a terms and posts associated with another term?
The archives widget uses the wp_get_archives function to generate the dropdown list. As you can see from the source code, there is no native way to use other dropdowns than yearly/monthly/weekly/daily. Unfortunately, there also is no hook to insert your own quarterly dropdown. So, there is no easy way to do this. There is a … Read more
Put domain.com/shop/product-name as a custom link in your menu of site. and make it as a home page so whenever someone clicks on domain.com/shop, it will go to your one page product.
you can use the category-slug.php file name if you want to have a custom page for each category https://codex.wordpress.org/Category_Templates here is a link that will help you.
Now when you give more than 1 category to a post, you can tell directly in the category which one is the main one and it will be used for the URL.
First things first. Do not you query_posts(). Use WP_Query instead, to prevent messing with the main query. Now, as for your question. WP_Query allows you to enter data parameters too. It even has a date query which you can check it out in the link I’ve provided. Instead of using Admin-AJAX, you can write a … Read more
Use the Taxonomy_Parameters in WordPress WP_Query like that: $args = array( ‘posts_per_page’ => 6, ‘post__not_in’ => $do_not_duplicate, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘art’, ), array( ‘taxonomy’ => ‘country’, ‘field’ => ‘slug’, ‘terms’ => ‘france’, ), ), ); $myposts = get_posts($args); you can add the “country” … Read more
Before anything, you should create a child theme, so you can update the parent (Twenty Fifteen) without worries. Looking at the WordPress hierarchy, you could copy the archive.php to the child theme and edit it, but would need to check what archive it is, of posts, custom post types, etc. Instead, copy archive.php twice, rename … Read more
I’ve not reviewed your code, just a quick thought: Have you tried Going to Settings => Permalinks and just clicking ‘Save Changes‘? That flushes the rewrite cache.
My first idea (I’m not sure it’s the most efficient) is to do a redirection in the file category.php or archive.php depending of your theme. Try with this code before the get_header() line : $term = get_queried_object(); if ( (“category” === $term->taxonomy) && (0 !== $term->parent) // if it’s not a 1st level category ) … Read more