Articles of categories

Slider won't work with custom query

I’m trying to set up a slider with the most recent posts from a certain category, but I can’t seem to get it to work. When I use the regular loop, the slider works just fine, but as soon as I add the new query for the specific category, the slider won’t work anymore – […]

How to filter custom post types by custom category taxonomy

I’m running WordPress 4.6.1 and I am trying to learn how to filter custom post types by a category taxonomy process. This is very helpful as non-technical folks can easily filter custom post type posts by category in the admin. This is my setup… I’m building a child theme off of tweentysixteen I created and […]

Categories list loop – add separator every year

I have a code which shows categories list with images. Im using plugin to attach image to category. Working code is: <?php $args=array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ) ?> <?php foreach (get_categories( $args ) as $cat) : ?> <h3><a href=”<?php echo get_category_link($cat->term_id); ?>”><?php echo $cat->cat_name; ?></a></h3> <a href=”<?php echo get_category_link($cat->term_id); ?>”><img src=”<?php echo […]

Get Meta Keys of Custom Categories

I’m having trouble getting the meta keys of custom categories. I tried dumping all the meta keys and values of a post by using get_post_meta() as such: $myvals = get_post_meta($post->ID); var_dump($myvals); However, the output doesn’t include custom categories (not even the regular category). I made sure that my post does contain values in these categories […]

WordPress custom post categories and subcategories on category.php

I’ve custom post “products” with standart categories and subcategories. Now I need to display a list of products on category page, that current category contains. If category don’t have subcategories I need to display this: <ul class=”cat-arc-links”> <li><a href=”#” class=”product-link”>Product 1</a></li> <li><a href=”#” class=”product-link”>Product 2</a></li> <li><a href=”#” class=”product-link”>Product 3</a></li> …… </ul> And if category contains […]

How do I change the category permalink structure?

I’ve been trying to figure this out for ages. Please help. I want my category pages to default to www.teacherdavid.co.uk/blog/category However my category pages default to www.teacherdavid.co.uk/categories live example: https://www.teacherdavid.co.uk/interviews/ I can access the category pages at www.teacherdavid.co.uk/blog/category however this is not the where you are taken to when select to view a category page […]

Un-highlight Blog Menu Item when Category Menu Item is Selected

On a site I’m working on, I am using a blog category called ‘Podcast’ for any podcasts that are posted. I have this as a menu item as pictured. My only issue is, that when I click podcast (just a link to /blog/category/podcast/ it highlights both the Blog and Podcast menu items (pictured above), which […]

Building Menu from Woocommerce Product Categories

I have created all of my Woocommerce product categories absolutely no problem there. Now I want to build my shop menu using the categories. The problem is, I have multiple categories with the same name but have different parents. As you can see from the image above I have no idea which categories “Carbon” or […]

WP 4.7 in_category change?

Since upgrade to 4.7, this code line is no longer returning: function foo(bar){ global $post; if(in_category(“my-test-category”, $post)) return; echo “Not in my-test-category”; } Did something change with the in_category filter? Note: “my-test-category” is a child of “Uncategorized”

Better approach for a WordPress Inventory

I am building a Inventory project just to learn wordpress more. Now scenario is like this . when the admin adds a new product from Front-end and not from wp-admin. So when I add a product from UI. First option will be Product company name. Now there will be a dropdown for all product company […]