Every Post in WordPress is filed under one or more Categories. Categories allow the classification of your Posts into groups and subgroups, thereby aiding viewers in the navigation and use of your site.

learn more… | top users | synonyms (1)

0
votes
1answer
44 views

Get Attachment Category Name

How can I call the name of an attachment category? Something that would look like <?php get_attachment_category_name ?> or $attachment->category_name This would simply output the name of ...
2
votes
2answers
337 views

Sticky posts on home page, search, tag and archives without plugin

I have a question today. I am looking for a solution to make sticky post available on my website. But, i just got it work on homepage with the code below. function wpb_latest_sticky() { /* Get all ...
1
vote
2answers
65 views
+50

Load custom posts with same tag as page

I'm using this plugin to add tags for a page: http://wordpress.org/extend/plugins/post-tags-and-categories-for-pages/ And I've added tags support for the custom post: function codex_custom_init() { ...
6
votes
3answers
3k views

Filtering categories in the permalink structure

Using /%category%/%postname%/ for the permalink I get a URL string of all the categories that the specific post is included in. I would like the categories in the url to be filtered down to only one ...
1
vote
1answer
775 views

How to get product count with respect to categories in WooComerce

Hi I want to display all the categories of products in a loop to display them in category menu along the numbers of products each category contains. Some thing like that so far I have done this to ...
-4
votes
0answers
23 views

how to build categories in one page theme, [on hold]

I am new Wordpress user. I want to build one page theme. I am unable to change the name of the predefined category in 4.5.2 version. Need help to sort this problem.
0
votes
1answer
245 views

How to add current custom taxonomy slug to body class

My theme uses custom taxonomy called "kbsection" and there are lots of sections set up (instead of categories). There is also a custom post type and the posts are assigned to sections. I need to ...
0
votes
1answer
423 views

Get current_parent_category in a loop or Cat ancestor- big problem

Im having some trouble since a week now . .. I'm having a bad time with that ! I explain my situation: I have setup a style for post category. (a background-color and a small image background). ...
1
vote
0answers
12 views

How to Add 'Post Categories' to the Dashboard Sidebar

I'm currently working with a company to make a few basic tweeks to their WordPress site and I noticed that they have this on their sidebar: I am looking particularly at the "Clients", "Offers", ...
0
votes
0answers
10 views

Linking Page, Posts & Category together

I want to create a page named Works with the built-in template called Project Listing. And have to make individual posts in the page Works. However, I am not able to do it. Though I can create the ...
2
votes
1answer
17 views

How to order category.php loop by 'meta_value'?

So I have a basic loop on category.php that displays all posts from the specific category, like this: <?php if (have_posts()) : while(have_posts()): the_post(); ?> <a href="<?php ...
0
votes
1answer
31 views

How to get post with slug and exclude categories

I want to do a query to get posts with a slug and category__not_in. Here's what I do: $query = array( "name" => "test", "category__not_in" => array( 15 ) ); query_posts( $query ); ...
0
votes
3answers
5k views

How to get child category list post in one template?

Here is what I want to have My category Structure in WP admin Cat Parent -Cat Child 1 -Cat Child 2 -Cat Child 3 -Cat Child 1 This what I want to have in one template: It show the list of ...
0
votes
1answer
13 views

Question About Messing With Category Pages and Descriptions

For a long time I was trying to figure out how to add category descriptions to not only the top of the category pages, but also to the bottom as well. There seemed to be no solution to this (absent me ...
0
votes
1answer
2k views

forming WP_Query for posts of all post types but from specific categories

I need to get post from blog, custom post type 1, custom post type 2. custom post type 3 and either from category 1 or category 2 or category 3 or category 4 or category 5 or category 6 or category 7 ...
0
votes
1answer
19 views

Add custom field to attachments in a specific category

I have a working function that adds a meta field to all attachments (so I can enter the url of a video). I would like this field to populate only on attachments in the "video" category. I've tried ...
0
votes
0answers
20 views

How to access to the primary category of a post? [on hold]

On wordpress you can choose a "primary category" among the selected categories of a post. I want to know how to access to that category when i'm in the loop.
0
votes
0answers
15 views

Wordpress using get_term to retreive slug not working as expected

Im using the below code to try and get the slug for the current category and the parent category. Ive managed to get as far as getting the currently cat slug but the parent displays in readable text ...
0
votes
3answers
2k views

Get id of category from drop down menu

Im trying to get the category ID from wp_dropdown_categories();and then pass the ID into a loop to have it output posts titles from that particular category. I currently have this: <form ...
0
votes
5answers
832 views

Exclude subcategories from the url

We have a site with categories and subcategories. If anybody navigates to a content belongs to a subcategory the url will have the following form: domain/main-category/sub-category/mycontent/ But we ...
1
vote
0answers
12 views

How to list categories within tags?

I'm currently working on an ecommerce site with WooCommerce. I'm using product categories for product types (e.g. cards, DVD's), and product tags for topics/themes (e.g. Christmas, children). What ...
1
vote
1answer
14 views

Different post styles depending on category

I am using Zephyr theme The link to the blog page. I want to style each post differently based on the post category ex: social media, announcements ect. I would like to style them using a cards ...
0
votes
2answers
1k views

How to make subcategory for custom post and and display?

I've created a custom post with categories like books, foods, and make some sub-categories like in foods cat, pizza, fastfood. But when I display them in my side bar, it's showing same as sub ...
0
votes
0answers
13 views

How do I let users specify interests on signup and have this reflect content displayed on homepage?

I'm looking for something that will allow my site to have the following functionality: A user creates a login for my site. When creating a username and password, they also select from a list of ...
0
votes
1answer
541 views

Taxonomy Category category.php not working

I have created custom post type, taxonomy and categorys. When viewing the category it seems to be using index.php and ignoring the WordPress template hierarchy. Any ideas why category.php, ...
-1
votes
0answers
11 views

-woocommerce- Adding multiple parent category to a Sub category? [closed]

I currently have a client that sells door mats(for example) He is currently using the Woocommerce plugin for Wordpress and having trouble assigning parent and sub-parent category's. He has 2 parent ...
0
votes
0answers
14 views

Retrieving category pages from subcategory returns empty sets

I've a category overview page. It shows its subcategories. These subcategories have subsubcategories which are pages too. I'd like to retrieve those (title, permalink and excerpt) but so far my ...
0
votes
1answer
35 views

Change single.php template based on parent category

I have the following code working but with split() being depreciated and not available in php 7, I need some help. The idea here is this code is inserted in my single.php (in child theme). When a ...
4
votes
0answers
48 views

Delete a specific category when deleting a user

I'm using the following function to create a portfolio category named "tips_username" when a user registers on my website. add_action('user_register', 'auto_create_traveltip_category'); function ...
0
votes
2answers
2k views

Filter categories using tags

I have a website with the following categories: Videos Pictures Stories And I have a lot of tags like: Funny, Awesome, Mind Blowing, Crazy, etc. Is there a way I could filter lets say: Videos ...
1
vote
1answer
19 views

How to get the number of child categories a specific parent category has?

How do we count the number of child categories of a parent category? I am using a custom taxonomy, called: "authors". I found this code, which does count the number of child categories, but only ...
0
votes
0answers
13 views

How to query post from sub-categories on category archive and display posts?

On a custom taxonomy archive from the taxonomy called 'books' (taxonomy-books.php) I want to list all subcategories that are assigned to the parent category. And then for each subcategory I want to ...
1
vote
0answers
15 views

Render Selected Categories in Admin Edit Post Screen differently

Selected Categories for a post in the admin screen are rendered by: // Put checked cats on top $output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) ); ...
2
votes
1answer
634 views

How to put enctype=“multipart/form-data” in categories form?

I had success putting the code below to include enctype (for images) in custom post type forms, but I'm not able to use it in categories form... is this possible? Thanks. add_action( ...
-1
votes
1answer
33 views

Using a filter in functions.php to add content to single posts regardless if post is in main or child category

Im using following filter (codex) to add some html content with a lower priority (20) to the bottom of my single posts wich are in a specified category: add_filter( 'the_content', ...
0
votes
1answer
20 views

how to get postmeta info based on multiple categories?

I need to get one meta_value from wp_postmeta and I can do it with one category but I'm having problem when using another one. I have: SELECT wp_posts.ID, wp_postmeta.meta_value FROM wp_postmeta ...
0
votes
1answer
686 views

query_vars in plugin when using custom permalinks

I am trying to do the following I need to get the category of the current page at the plugin level so before it goes to archive.php orsingle.php so i have a plugin to do this and based upon ...
1
vote
0answers
15 views

Reload parent categories list in (new) post

I have a question about parent categories list in a (new) post. I have few categories what I would like to exclude from parent categories list. When I open (new) post page, few categories are ...
2
votes
3answers
2k views

Fixing category count

Somehow my post counts are incorrect due to inserting rows via php. I have the following code to update the count, is it correct? global $wpdb; $result = mysql_query("SELECT term_id,term_taxonomy_id ...
1
vote
1answer
593 views

WordPress Genesis not excluding category from blog

I am trying to exclude a category from my blog. I login to WP and go to Genesis and Theme Settings and add the category IDs to the Blog Page Template area and hit save. Nothing happens. I have also ...
1
vote
3answers
372 views

Add default content to post (for specific category)

I'm trying to add some default content to my posts using this code in my functions.php: add_filter( 'default_content', 'my_editor_content' ); function my_editor_content( $content ) { $content = "My ...
2
votes
3answers
1k views

WooCommerce change category url and product base

I want to display the url's like this: for Category: /webshop/categories/hoodies/ for products: /webshop/categories/hoodies/test-product how is this possible without giving me 404 not found ...
2
votes
2answers
1k views

Wordpress Child Category Display All Posts

I am creating a Wordpress page where all my posts in the child categories of team are displayed in a grid. I got this working with the below code. The formatting and general layout is great however it ...
0
votes
1answer
452 views

Can't pull posts of a Custom Post Type based on the custom taxonomy of the CPT

My question is about retrieving custom post types via get_posts, when custom post types also have a custom taxonomy. I can use get_posts to retrieve all posts of a custom post type, but when I attempt ...
0
votes
1answer
1k views

Show custom menu in category and its posts

I have a category X of posts. The category page and it's individual posts are all part of a custom menu consisting of pages and posts. My submenu, in the sidebar, works fine for showing on the pages, ...
0
votes
0answers
32 views

Accessible Subcategory URL's pages without using .php hack

I'm attempting to setup a custom URL structure within posts that makes all parents and sub child's accessible, but all attempts have failed with various errors. My category structure looks something ...
0
votes
2answers
3k views

Display one latest post from multiple categories

This should be very easy, however for some reason I can't find a working snippet anywhere on the web.. I basically need to display one latest post from 6 categories (can be changed to 7,8, etc etc) ...
1
vote
2answers
524 views

Echo one category as title when post has multiple categories?

UPDATED QUESTION to be CLEARER Here's my situation: Wordpress top navigation has several menu items that jump to an array of posts within a specific category. For example, if you click "necklaces" ...
-1
votes
0answers
16 views

WordPress category Pagination Not Working After Modify the Loop [duplicate]

I modify the category page loop as following code. Now Pagination not working. Why is that? How to correct it? Note : Even though there many similar questions on this site any of them not solve the ...
0
votes
0answers
14 views

Assigning custom-single.php based on category

The code below looks like exactly what I need but I dont know how to update it to work for 3 custom single.php files plus the default single.php for any other posts not in one of these 3 categories ...