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
25 views

Show One Category on Post

How do i go about making the code only show one category? <?php $categories = get_the_category(); foreach($categories as $key => $category) { $url = ...
0
votes
0answers
100 views

Keep active class in post page

I have one category and under this category I have many posts. Normally when I go to my category page from menu it added active class class="current-menu-item". Bellow is the rendered html <ul ...
0
votes
1answer
133 views

Mass/Bulk assign categories to posts

I need to assign categories to about 200 posts in bulk. Each post would have a few categories. I have the post ID's along with the Category ID's for each post in a text file like this: Post ID, ...
0
votes
4answers
392 views

How to exclude categories from recent posts, recent comments & category widgets?

I use the bellow function (thanks to @helgatheviking!) to exclude categories from the wordpress loop. It works very well - posts of selected categories are excluded from the loop on the main blog ...
0
votes
2answers
96 views

Make parent category an optgroup

How to transform the parent category into an optgroup? Demo of what I want: http://fiddle.jshell.net/Pp7Ey/show/ Currently I have this code: $cat = $_POST['cat']; $data = array( ...
0
votes
1answer
44 views

Assign parent category to all posts that are already assigned to child category

All my website's posts are assigned to subcategories, but not to their parent categories too: Is there someway that I could massively assign posts to their parent categories too? My website has ...
0
votes
2answers
513 views

wp_update_nav_menu_item() to insert categories

In the script below, I'm attempting to dynamically add categories to a custom menu. Everything works great, except for the fact that the categories do not have hyperlinks. What am I missing in ...
0
votes
3answers
47 views

How can I add single catogory for custom post type?

I am add new post type called journal using below code it works fine. But I now I need to add a single category for this post type. That is I have two types of journal category normal journal and ...
0
votes
1answer
91 views

Retrieve latest post by multiple categories with ID

I have the categories listed below in my product post type. Category Name: Test 1 ID: 82 Category Name: Test 2 ID: 83 Category Name: Test 3 ID: 84 Category Name: Test 4 ID: 85 Now I want to ...
0
votes
0answers
125 views

Admin - post order by category and sub category

I am trying to get the list of posts ordered in the admin area when sorted by their parent category. Ideally it would sort like this: parent category 1 -child category 1 --post 1 --post 2 ...
0
votes
2answers
623 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
2answers
561 views

Optimal way to redirect home page to category archive?

Question What'd be an optimal way to redirect the home page of a WordPress site to a category archive without involving external factors (e.g. Apache's .htaccess) i.e. within WordPress? Why? (Only ...
0
votes
4answers
97 views

Use standard WordPress categories with a CPT

I've just converted all of my blog posts to a CPT because I needed them to be hierarchical. Problem is, I had categories assigned to all of the posts. How can I use the standard WordPress categories ...
0
votes
1answer
259 views

Random Featured Image Based on Category

I am looking to extend the below code to select a random featured image based on a specific category. The below works but uses an overall list of images to pull from vs a list of images based on ...
0
votes
2answers
103 views

Get the post_type of current taxonomy or category page

I want to get post type of currently visited category or term. As for example, I have post_type post and category named Blog. On Blog listing page, how can I get that this is a category of the ...
0
votes
1answer
648 views

Single.php Active Category Class

Currently by default (I believe) when you're on single.php, Wordpress doesn't add a "Active" class to the blog category you're viewing the single post in like it would for pages or if you're on the ...
0
votes
1answer
214 views

Show Secondary Sidebar on Category pages (archive)

My site has the following structure where one column is for the main content (articles) and the other one, on the right, is for the sidebar (primary sidebar). The theme allows me to change the layout ...
0
votes
1answer
110 views

How to make all posts in a category “unsticky”?

The other day I posted this question. Now I'm wondering how I can do the same thing except this time instead of making unsticky posts sticky the code should make the ones that already are marked as ...
0
votes
1answer
66 views

How to make all posts in a category sticky?

Total WP and web development noob here. As the title suggests, I'm trying to make all the posts in one of my categories into "stickied" posts. But so far I've had no luck. What I've tried is this ...
0
votes
1answer
774 views

How to have Multiple Archives Widgets, one archive widget per category (in a different page)?

Please read the whole question before assuming this question is repeated. After one day of trying plugins and tutorials, I am convinced that there is no straightforward method of achieving what I am ...
0
votes
3answers
203 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 ...
0
votes
1answer
249 views

How to display posts from specific category using get_option function?

I try to display posts from specific category only in a author page, using get_option function like in the code below but it does not work: <?php query_posts('cat='.get_option('admin_cat')); ?> ...
0
votes
2answers
564 views

Displaying a custom field in Category Archives

I am using WordPress 3.5.1 / Twenty Twelve Theme. I would like to display a custom field in my Category Archives. I have the following custom field working in my single.php , it displays a custom url ...
0
votes
2answers
447 views

Grouping categories by genre

My wordpress video blog have several categories. Lets say the category can belong to several genres e.g actions,horror,mystery and another category belong to actions,horror,romance How do I group ...
0
votes
1answer
3k views

How to create a category and sub-category sorted blogroll with all posts?

I would like some help to post all the posts of my website into a blogroll sorted by categories and subcategories. The end-result HTML I would like to see displayed would be something like this: ...
0
votes
0answers
63 views

Add Custom Post Type Categories to General Categories

I've created three custom post types. I want them seen as general categories. I could not find a solution, can anybody help me? Thank you.
0
votes
1answer
218 views

Category Descriptions - HTML?

Is it possible to allow HTML to be rendered in Category descriptions? My theme uses them quite a lot, and I'd like to style them better with images and links. This seems to be do-able from what I ...
0
votes
1answer
30 views

Link each category to last post

I would like that each category link to the last post of each category. category 1 ----> link to the last post of category 1 category 2 ----> link to the last post of category 2 category 3 ----> ...
0
votes
1answer
113 views

Editing “Kahi's Highlight Used Categories” plugin code - highlighting parent and child category in post page

I´m trying to highlight (using css), the child and parent categories in use in the selected post. So I´ve found this plugin "Kahi's Highlight Used Categories". Plugin´s website: ...
0
votes
2answers
851 views

Add multiple orderby with pre get posts

I am already using a small code to set default sort orderby a custom field called "Year" I need to add another orderby to also sort by "Post Title" in the same sort. Sort = Year-Customfield (DESC) ...
0
votes
1answer
736 views

Advanced Custom Fields: Using category as a rule, before publishing new post?

I am using Advanced Custom Fields plugin to assign some fields to posts with a certain category, but the fields does not appear before I publish the post. I have made some links on the dashboard, so ...
0
votes
2answers
949 views

Display all posts from specific categories on a page

I want to display all posts from specific categories on a single page. Therefore I edited the page.php file in my theme folder. I added an 'if-clause' to check which page currently being displayed and ...
0
votes
1answer
1k views

How can I make wp_list_categories output li with category-slug as class, for its children?

Simply put, I'd like to change the wp_list_categories output from this: <li class="cat-item cat-item-1"><a href="http://mysite.com/category/articles">Articles</a></li> ...
0
votes
1answer
1k views

How To Find Out Wordpress Category Table in MYSQL?

I know WordPress stores all post data in 'wp_posts' table. But here WordPress not define any category id or reference related with it. Please let me know, how 'wp_posts' table find out exact ...
0
votes
1answer
567 views

How to Set an Individual Homepage for Each User?

I would like to give my users the ability to customize the homepage of the site. For example, if somebody is not logged in only the default categories appear. Once someone creates an account and ...
0
votes
1answer
221 views

Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?

I added the code below and successfully changed my CPT slug for the taxonomy terms. My blog permalinks are /article/%postname% in case you wonder, and I'd like to keep it that way, so no clashes with ...
0
votes
1answer
1k views

How to choose a sort order (for posts) per category? (ideally when creating a new category)

Assume I have a bunch of posts (articles) in two categories: "upcoming events" (cat=1) and "past events" (cat=2). When listing all posts of a specific category out of those two, category 1 shoud be ...
0
votes
1answer
1k views

Use template of parent category for single post sub-categories

I have single post templates in a folder in my child theme marked "single". I need the sub categories to use the same template as their parent. I've read a dozen tutorials all of which were more than ...
0
votes
2answers
131 views

Can the_category display a post count?

Is it possible for the_category to display a post count within a post. Looks like Posted In: Category Name (3),Category Name (2) etc etc Possible or not? I would just use wp_list_categories but it ...
0
votes
1answer
135 views

If no posts in category display Form instead of not found

I have a couple of categories that don't contain any posts (yet). What I would like to do is have a form which takes users details for future posts. Am I right I thinking I simply edit the page ...
0
votes
1answer
549 views

How to Check if a Child Category is Being Queried

I need to change the number of posts queried for specific categories 'Recipes' or 'Product Reviews'. The below code works great for this, I have it in functions.php: function ...
0
votes
1answer
673 views

I use same slug name for category and page

I added one slug and page with the same name and they worked fine, but when creating a second WP forced me to rename the page (being created after the category) with an additional "-2" how to clear ...
0
votes
1answer
128 views

Get post related on category

it's a catalog website for different product. I need a function that will get the category of the selected product, and get all the product from that category Let see an example. A table, is in wood ...
0
votes
2answers
625 views

Custom Post Type, Two categories, Two columns with Pagination

I searching a lot to found a way solves that and no luck at least. Sorry for my unpulish english, I do my best explaining my issue. I have a Custom Post Type called 'Events' this have two categories ...
0
votes
3answers
3k views

Using same slug name for a page and category

I know it isn't good practice but I'm considering using same name slugs for some pages and categories on a site that I'm working on. It's a small site and it doesn't seem to affect anything in ...
0
votes
1answer
1k views

Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category

I'm trying to get the terms of a taxonomy (kind) and the number of content they have but only for a specific category (get_parent_page_slug() = city name = category slug). This is what I have so far: ...
0
votes
2answers
990 views

Display most recent post in category instead of archive?

I've successfully redirected my blog page to my most recent post - i.e. so when you click the 'blog' link in the nav it goes to the most recent post page and you can click next/prev buttons to ...
0
votes
1answer
293 views

How to display a category list in a mediawiki like way?

I would like to reproduce on Wordpress the same behaviour of mediawiki when it comes to display the posts of a certain category (with an alphabetical order, in columns and using first letters in bold ...
0
votes
2answers
624 views

Pagination for query_posts();

I know there have been many question like this and I've read them, but I still cant get it working... I have this query: query_posts(array('cat'=>3,'posts_per_page'=>5)); And I simply display ...
0
votes
1answer
578 views

Show Subcategory Description

I'm using the following code to show the subcategories of a category within my archive.php page: <?php if (is_category()) { $this_category = get_category($cat); if ...