Shop Category Pages missing s
Shop Category Pages missing s
Shop Category Pages missing s
Trying to get categories and sub-category listing
I had no idea if this was somehow related to wordpress configuration, or yoast, but I learned that this error was caused by the redirection plugin. It was monitoring permalink changes and created records that it didn’t need to, and associating new pages with those records. Deactivating the plugin allowed me to create new pages … Read more
The function get_category_parents will get you a string of the parent categories given the ID of a child category. So, like this: $cat = $wp_query->get_queried_object(); $catid = $cat->cat_ID; $parentcats = get_category_parents ($catid, false, ‘|’, false); This will give you something like category1|category2|category3. Follow the link above to see what other options you have. If you … Read more
Figured it out. Missed the concatenated class dot for the data-filter attribute… Changed this line: echo ‘<button id=”category-filter” data-filter=”‘.$term->slug.'”>’.$term->name.'</button>’; To this: echo ‘<button id=”category-filter” data-filter=”‘ . ‘.’ .$term->slug.'”>’.$term->name.'</button>’;
I found the answer. It’s a plugin “WPB Accordion Menu or Category PRO”. I’ve disabled it and it’s working again.
I would suggest you hand-build the navigation menu using the selected taxonomy terms, not using a script to automatically add them, which is where you would have problems with new terms being added.
I found this item, that might be a good start; but the difference is that we need not to specify each specific category, the basic must be, one itme of all recent posts. how tho change number of posts in loop from specific categories
I just realised I already have the parent from here $category = $_GET[‘category’]; So I changed my code: <td class=”custom-cat”> <span class=”term”> <?php echo $category; ?> </span></td> <td class=”custom-sub-cat”> <span class=”term”> <?php $terms = get_the_terms( get_the_ID(), ‘custom-category’ ); foreach ( $terms as $term ){ if ( $term->parent ==! 0 ) { echo $term->name; } } … Read more
Maybe I somehow misunderstood your question, but you don’t need the tax_query for that, just use the $ids = array( <ID1>, <ID2>, … ); $q->set( ‘post__in’, $ids );