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)

1
vote
1answer
32 views

Random post category URL

I'm trying to get a random post URL, only in current category. This is my code, this returns the URL category, :/ <?php $current_cat = get_the_category(); $randomPost = $wpdb->get_var(" ...
2
votes
1answer
44 views

Categories' hierarchy in URL

The posts in the website I'm currently working on have multiple hierarchical categories applied to each of them. For instance: Source - Books -- Moby Dick -- Sherlock Holmes The permalinks are set ...
0
votes
0answers
35 views

Next/Prev category post in same button

i like to put a navigation link in my posts, can you help me? How can do this? http://prntscr.com/64ksjd I've this code but, it show 2 hiperlinks, i want 1 hyperlink: $post_id = $post->ID; ...
0
votes
1answer
36 views

WordPress - List Sub Categories and Sub-Sub Categories, With Posts

I have the following code. It allows me to show sub categories and documents within them. The thing is, a sub category may contain further sub categories. The code below will show documents belonging ...
0
votes
0answers
81 views

Display only children category, then if else, only parents category in a loop

I explain the situation: I have a blog, which has lot of post, some are assign to only some parents category, some only to childrens category, some to both. I'm looking to achieve the following: ...
0
votes
1answer
38 views

Hide a category of posts from main blog, and only show in category view

I would like to hide a post on the main blog page (run on index.php) and have it only show up when the visitor views a particular category. I have tried the following just before the loop: <?php ...
0
votes
0answers
32 views

Category-Slug.php custom template - no output!

I simply want to output two different categories on two separate pages. I need the two categories to form two rss feeds to Mailchimp, which is fine. I've created two category-categoryname.php files ...
0
votes
0answers
18 views

How to print search results related categories hierarchical?

I'm trying to print search results related categories hierarchical in sidebar area. I did that but my code prints just terms without their parents. Here is my page. I want to print the terms like ...
0
votes
0answers
8 views

I changed Category label of category taxonomy on main page… What about paths when choosing a category?

I am using a free wordpress template where I changed the label of Category taxonomy on the left side of the page from "Categories" to "States" (using wp-includes/default-widgets.php). Then, I ...
0
votes
1answer
60 views

Display category title and three latest post inside the category

I am looking for something very similar to this question. However, the answer provided there seems strange to me. I don't know what the arguments posts_per_page=-1 and it seems more like a hack to me ...
0
votes
1answer
38 views

Only list category if it has a custom field image

i've a problem showin a list categories. $args = array( 'orderby' => 'name', 'order' => 'ASC' ); $categories = get_categories($args); foreach($categories as ...
-1
votes
1answer
57 views

How to restrict the amount of categories/post tags/terms for a post type post

I'm in need of a solution that allows me to restrict the user/author to only use maximum of two categories per new post. One post can only have one or two categories. The only similar solution that ...
0
votes
0answers
15 views

portfolio by category -> sub-category

I have a portfolio page and I wanted to display the items by category->sub-category. At the moment they are displaying in alphabetical order irrespective of parent-cat sub-cat. I have this in the ...
0
votes
1answer
33 views

ACF no print data [closed]

I've a problem with Advanced Custom Fields Plugin I create a custom field named: bgcolor I want to print the value in category.php, this is my code: $color = get_field('bgcolor', ...
0
votes
2answers
101 views

Meta data (Tags and Categories) for Custom Posts not showing.

I registered a custom post type ("movie") with tags and categories. Now, I'm able to filter and search for the custom post with these tags and categories, so I know they're present and working, but ...
0
votes
0answers
17 views

Permalinks for categories…making sure that you get the right link in a Category Archive

I recently completely a site with a lot of categories and sub-categories. And in many cases, a post might go in multiple categories. Of course, I know how to do that by simply checking off multiple ...
0
votes
1answer
64 views

WP_Query - using category__and when one of the categories is 0

I am passing a variable $category to category__and, and it works unless $category = 0; 'category__and' => array(4) // works 'category__and' => array($category, 4) // works if category > 1 ...
3
votes
2answers
2k views

Remove / Rename Uncategorized Category In Wordpress

I have installed wordpress Muilit Site (NETWORK) I need to Remove / Rename Uncategorized Category In Wordpress. How is this possible?
2
votes
1answer
361 views

How to exclude uncategorized from permalink structure /%category%/%postname%/

I'm using a custom permalink structure: /%category%/%postname%/ So that my posts are listed like: mysite.com/widgets/blue-widget This works fine as long as "blue-widget" exists in one and only ...
0
votes
0answers
21 views

Add a Tag to each Post in a Category

I have large number of posts in a certain category. I wanted to add a tag to each post in that category. Here is the procedure to try but not work. Create the new tag. Get the new tag’s ...
0
votes
0answers
26 views

List post categories that link to a page showing those posts

I have posts with different categories. I have a blog page that lists the posts like this. <?php $blog_args = array( 'post_type' => 'post', ...
0
votes
0answers
13 views

Separate blog archives by category

I have two categories for the blog posts on my site, lets call them A and B. I want to add an archive widget (by month) to the right sidebar that only uses category A posts and only shows category A ...
0
votes
1answer
63 views

Display 2nd category, only once, as sub-heading, in the loop

I have a Custom Post Type ("Rental"). I am using the code from this article I found to display Rental custom posts on a page, with the Categories of a custom Taxonomy ("Region") as headings between ...
0
votes
1answer
47 views

More efficient way to list posts by category [duplicate]

I have a page that lists posts grouped by category. Here is the current code: <?php $cats = get_terms('category'); foreach ($cats as $cat) { $cat_id= $cat->term_id; echo ...
0
votes
0answers
14 views

WordPress category pagniation not working

I am trying to add pagination to category the URL comes out in the format as /category/cross-stitch/page/2/ but nothing shows on the page its going to 404. My code is below, which works for pagniation ...
0
votes
1answer
86 views

Add category to all post by using sql query?

I have a thousand posts and all them don't have category. Do you know how to associate category with all posts by using sql query?
0
votes
0answers
16 views

Category slugs being appended “category”

I presume this is because the slug already exists elsewhere e.g. I have a page called /solutions/customer-experience and I want the category slug customer-experience, I try to enter it but it gets ...
0
votes
0answers
45 views

How To Get WordPress Categories Last Update Date?

I am trying to make a custom sitemap for my WordPress blogs categories. For that I added the below code in my functions.php file and save it. Now all things is working fine but I want to get the date ...
0
votes
3answers
596 views

Force Wordpress to Show Pages Instead of Category

I am trying to create a SILO structure on one of my WordPress site. I have always checked this option on Yoast SEO plugin "Strip the category base (usually /category/) from the category URL." So my ...
0
votes
1answer
54 views

Related content based on category name

I'd like to modify the code below so it grabs the data based on the category the post is in and 'only' that category, not children categories, not other categories, only the category of the current ...
1
vote
1answer
42 views

How To Get WordPress Categories Link List?

I am trying to make a custom sitemap for my WordPress blogs categories. For that I added the below code in my functions.php file and when I save it, my Blog goes white. Nothing is showing up. I ...
0
votes
1answer
59 views

Same menu for different taxonomies to reach different content

I'm using a "location" taxonomy to show the same website for 4 different locations. Each of them will have the same categories which I want to display in a menu. Is there anyway to create the same ...
2
votes
1answer
78 views

How do I change the sql query for wp_get_archive()

I am using wp_get_archive() in category.php. If I am on page of category=2 it should show my archives of only that category. However it is for all the categories. So how can I change the query for ...
2
votes
1answer
172 views

Display only posts from referred category on date archive page

I am using wp_get_archive() in category.php. If I am on page of category=2 it should show my archives of only that category. However it is for all the categories. Following is the code for my ...
0
votes
1answer
49 views

Show div only if post is in specific category

In my list of blog posts, I would like to show a div which labels the post as a "Press Release" if the post is tagged with the "Press" category. I have added the following chunk into my loop: ...
7
votes
4answers
618 views

Allow users to create their own feed from selected categories?

I've been wandering around on the web for the last couple of hours wondering if there's a way to allow users to build their own RSS feed by selecting categories within WordPress, that could then be ...
0
votes
2answers
187 views

Check if current category has subcategories

I have found the following piece of code in the WP Knowledge Base theme in order to show subcategories of a parent category. The problem is that this only works for the first level of hierarchy, so I ...
0
votes
3answers
51 views

Getting category URL with hyphens, not spaces

So, I am using this to get the URL: <a href="/category/<?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?>"> Which is outputting: ...
2
votes
1answer
26 views

Multisite - create a category in specific site

I have a multisite I want to create a category but in a specific site. I used this functions below: wp_create_category('mycategory', 0); but this will create a category on the main site. I keep ...
0
votes
1answer
33 views

Group Posts by First Letter of Title categories

Questions is a duplicate of this one: Group Posts by First Letter of Title However, I was unsure whether I could ask on that, or I had to start a new question, so I did the latter ;) I implemented ...
1
vote
1answer
4k views

How to split the categories of subcategories with thumbnails

This is the code I use to display all product categories with thumbnails: <?php $cats = get_terms('product_cat', array( 'hide_empty' => 0, 'orderby' => 'name' )); ?> <div ...
1
vote
1answer
30 views

Excluding a category from next and previous post links

I am trying to figure out the code to exclude a category from my next and previous post links. My code for the next and previous is as follows: <div class="next_prev_cont"> ...
0
votes
1answer
21 views

Use post in multiple places on a page with multiple posts

I have three custom post types: workouts, news_items, and business_items. I'm trying to display the top (most recent) item from each on the home page and I'm trying to put the featured picture from ...
0
votes
1answer
51 views

How to link a PDF file to a category URL

I am not sure if it is possible to do this but I have a category called case-studies into which I write individual posts to summarize a case-study - for the sake of this question let's give a title of ...
0
votes
1answer
43 views

Multiple categories for one menu item?

I have six categories: Seasons Categories: Spring Summer Fall Winter Collections Categories: Formal Wear Night Wear Ready to Wear Sports Wear I need to put them up in the navbar custom menu ...
0
votes
1answer
82 views

Category Template for Custom Post Type

I'm driving myself crazy with the following issue, hope you can help me! I'm working on a WordPress theme for a business directory so I decided to make some custom posts types on functions.php file ...
0
votes
0answers
31 views

Page with the same name of a category

I've a category, let's say "testcat". I want to create some pages which the final url should be "http://example.com/testcat/pagename". To do this, I should create a page named "testcat" and then a ...
0
votes
1answer
23 views

I have many different products on my website how can I get them to display under specific categories?

How and where do I put code to get products assigned to categories. I bulk imported categories after I already had products setup. Now I was wondering how I can move all the different products to the ...
1
vote
1answer
34 views

Categories list into registration form

I'm trying to create a custom user registration form used for Educational website. Is it possible to automatically retrieve categories of posts (custom posts) in the registration form. The form ...
0
votes
0answers
67 views

how to capture the value of the selected parent category

I am very new to WordPress as well as coding and I am stuck with one of the form field, which has a select box for listing all categories and sub-categories (taxonomies) in it. But I would like a ...