Questions tagged [categories]

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.

Filter by
Sorted by
Tagged with
2
votes
2answers
9k views

404 Error On Category and Tags Pages

Okay So I'm facing a weird problem as i'm receiving 404 errors on blog category and tag pages. I'm using custom theme which includes: tag.php category.php archive.php home.php index.php and 404....
1
vote
1answer
834 views

create a page which displays a list of categories title+ short description?

I have some code that loops through all categories and: organize them on a Hierarchy of (parent) category and its child categories echo the titles +short description of each category +add "read more" ...
0
votes
1answer
2k views

Invalid Taxonomy

So I registered a custom post type as well as a taxonomy for that post type. I then created a couple items in that taxonomy, but when I go to click on any of them it turns up as Invalid taxonomy. ...
0
votes
1answer
931 views

How to show posts only for the last subcategory?

I have a hierarchical categories tree, meaning up to 3-4 subcategories with posts. When clicking on a category link in the home page, I am redirected to the category page. I need to check if there ...
1
vote
1answer
6k views

Dynamic dependent Dropdown lists for categories, sub-categories and posts

I'm using WordPress 3.5. I need a way to implement a code or plugin to allow users to navigate through posts using dependent(chained) dropdown lists. In other words I would like 3 dropdown menus to ...
1
vote
0answers
20 views

Read GET parameters in APACHE Mod Rewrite rules for WordPress categories in Posts

I'm a self-taught programmer with a very little experience in WordPress programming. I'm using a post permalink structure in this way: https://domain.com/parent-category/child-category/post-title-...
0
votes
0answers
10 views

Dynamically display sub-categories on primary menu without adding them

Title says it all i guess. All i need is not having to go on menu and add a sub-cat everytime i create a new one. also, is it possible to order them alphabetically?
0
votes
1answer
12 views

How to noindex, follow a specific category wordpress?

Google appears to be ignoring my robots.txt (despite being valid) How do I noindex, follow a specific category without plugins?
0
votes
2answers
2k views

Getting URL of archive (category) page

I'm trying to retrieve the current URL of the page, which works everywhere except for archive pages, for example, a category page. On a category page, it shows as the most recent post in that category....
0
votes
1answer
8 views

Hide a specific category title from displaying on site

I have a website that uses the theme Bodega and uses portfolio categories. Right now I have a page like this: http://185.56.86.90/~onetoncr/manitoulifeandhome.com/property-services/. And it displays ...
1
vote
2answers
10k views

Add class to items in wp_list_categories()

I have this in my category.php to show sub-subcategories: <?php if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != "") { echo ...
0
votes
1answer
15 views

WooCommerce - redirect single products in product categories to product page [closed]

As a proper UX measure, I want to redirect all the product categories containing a single product to the product detail page instead of the product category page to save them one step. Everything I've ...
0
votes
0answers
12 views

Display category in tree format

I have setup category in the structure below - A (parent) - B (child of A) - C (child of B) - X (parent) - Y (child of X) - Z (child of Y) and I need to display it in the same tree ...
0
votes
0answers
14 views

Listing only matched result line if specific tag and category is matched

For my Campus Project, I am developing a Travel based website where Touring Spots will be achieved and nearby Hospital, Shopping Mall and Hotel names will be listed on the following touring spots post....
0
votes
1answer
1k 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
0answers
20 views

Wordpress main category with ghost categories

I wonder if there is any possibility to select a "main" category for a post, but also select "ghost" categories, so that a wordpress post only shows the main category but also appears on the other ...
0
votes
1answer
385 views

How to get the term id inside the start lvl method of category walker?

I'm trying to implement the category walker with wp_list_categories to help me manipulate list classes, which i want to get the term id within the start_lvl method, so i tried to use $category->...
0
votes
1answer
2k views

Can't seem to filter wp_query by current category ID

I'm querying a custom post type ("donor") and would like to list them grouped by category (a custom taxonomy for this post type), with the category title then all posts for that category. After much ...
0
votes
1answer
906 views

How to not display a category post on blog page?

As you know, we can assign a "Category" to any post we write. We can also use a "Category" as link on the menu. Good! By default, WordPress will display all your posts in all the categories on your ...
1
vote
2answers
1k views

How to show WordPress parent and child category using a different template?

I am currently trying to do a directory style site, and I currently have parent categories and child categories. Right now, I have the parent categories showing and when a parent category link is ...
0
votes
2answers
21 views

Display all product tags associated with a specific product category

I need some help writing a shortcode to display all product tags associated with a specific product category which can be displayed on any page. My problem is that I can display all product tags ...
0
votes
2answers
1k views

Custom Category Archive Pages

I have a WP installation with 6 categories and I want 3 of them to use a custom Category Archive Page called "category-special.php" (default page is the "category.php"). I found the code below that ...
0
votes
1answer
859 views

Custom post type URL - filter by taxonomy

Created CPT = news uses default categories (IT and recruitment) I am struggling to view an archive of the posts based on their category mysite/news/ - shows all posts for that CPT whatever the ...
0
votes
3answers
5k views

get_categories only getting categories in the main language

I am trying to retrieve in the "content composer" the categories of projects based on the active language. But i only get the categories off the main language, never on the other. My code is: ...
2
votes
1answer
1k views

How to search only by post title and category?

I'm currently working on my first theme (based on underscores) and just realized the search does not return any results if I input a category name, nor does it give accurate results when searching ...
1
vote
2answers
4k views

How To Add and Display Category Image

I have created a WordPress plugin to create a widget area to display category names (total nmbr of post) and description.Now I want to show the category image just after the category name and after ...
0
votes
1answer
2k views

How to “group” (categorize) the Pages together?

I have a lot of Pages which can be (need to be) grouped under a number of different Categories. ** Then the more important thing is, i need to control those pages (of different groups) programatically ...
0
votes
0answers
12 views

How can I sort categories by slug in the backend?

Title says most of it, looking to sort categories by slug EVERYWHERE across my backend. I'm not looking to do this on the frontend, as I've already figured out how to display my categories in the ...
0
votes
1answer
7k views

Get 1st parent category id from post

I have this structure for my categories: Issue 4 - News - Supporting our troops - Breaking news <?php $category = get_the_category(); $parent = $category[0]->...
1
vote
1answer
19 views

Woocommerce category show subcategories only/omit posts for specific category

I have a woocommerce shop with 2000+ products. I have set the shop catalog to show subcategories AND products. However, there are some categories that are so vague that there is no need to show any ...
0
votes
2answers
397 views

How to run select query of post with category and tags?

I want to fetch multiple posts with categories and tags currently I'm using this query: $pagesize = 20; $pageNumber = 1; $mysql = mysqli_query($con,"SELECT p.post_title, p.ID, p....
0
votes
0answers
33 views

How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)

I got HTTP ERROR 500 when I tried to get all the posts from a hierarchical taxonomy which is category. I have a page and in this page I want to display all the posts. This page and those posts have ...
0
votes
3answers
3k views

Display selected category on post page

Lets assume that we have a post which belongs to 2 or more categories and we wish to display, on the post page, the selected category through which we reached to the post page. What is the best method?...
0
votes
1answer
391 views

Select pages by category

Is it possible to select pages based on category with the function get_pages? I've already added cats to my page taxonomy. The code below simply pulls all of my pages ignoring $args: <?php ...
0
votes
1answer
44 views

How replace individual <category> elements in the RSS feed with a single <category> string

We're sending RSS emails out to our list and would like to include the categories and tags. But when we add them, due to the way WordPress delivers them, they just end up in one big long string/...
0
votes
2answers
535 views

Removing Uncategorized on post save if other category present?

Is there a way to filter Wordpress save_post in a way that if more than one category is present, the Uncategorized category is unset/removed? This should works also on first post save
0
votes
0answers
12 views

Author archive page by category [duplicate]

I might have a simple question, but couldn't find anything on the web.. I want to create an author archive page by category. For example I have 2 categories: Apple Banana The Author archive page ...
0
votes
0answers
39 views

Displaying a Category on a Wordpress Page

I have a game.php file and all main categories are displayed there with a shortcode. output results by category. Question. You don’t need to output in category.php so that I don’t throw it on category....
2
votes
1answer
1k views

Custom HTML structure in wp_list_categories

I am trying to accomplish an Ajax navigation for the categories and for that I need the code to look something like: <ul> <li data-level="1">Parent Category</li> <li data-...
0
votes
1answer
389 views

Using pagination with multiple loops causes it to break

I'm have two loops on my index page. One fetches the latest posts from the 'work' category and the other fetches the latest from the 'blog' category. (see below) I am also using a plugin called WP-...
0
votes
1answer
27 views

Show Custom Post Type based on Category on Archive Page

I have created a new CPT called 'Properties' and have added a new taxonomy called 'Project Categories' which then have subcats called 'Current_projects' and 'Past_projects'. I want to have a button ...
0
votes
0answers
23 views

Help needed with category and title in header

First i am abit in wordpress , but anyway i am trying to show the page category and page title in my header.php . Like this below But here is the thing , what I like to know is there away to iether ...
0
votes
2answers
1k views

How to remove the “+Add Category” button from the Category metabox?

I would like to disable the "+Add Category Button" under the Category metabox so that anyone creating a post has to choose only from the list of existing categories. I did check out another post, ...
2
votes
4answers
1k views

How to disable Uncategorized category URL?

I would like to disable the Uncategorized public URL (i.e. /category/uncategorized), since I'm not using post categories and already have the posts list with pagination on the main Blog posts page. ...
0
votes
1answer
1k views

display specific category on page

I have been trying to get the posts from a certain category to show on a specific page. i am using the rock star theme and figured i could create a new page, use it as the template and use the coding ...
0
votes
1answer
485 views

Delete Term via edit-tags.php

I might get rep'ed down on this - but is there suppose to be a "Delete" link on the edit-tags.php page? Note: not the WP-List-Table, but the actual page where you specifically view the terms ...
0
votes
2answers
8k views

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 ...
0
votes
2answers
502 views

filter single_cat_title avoiding the breadcrumbs

I'm developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page. Just doing this: function subtitleCategory ($title) { return $...
0
votes
1answer
959 views

Only show current category post

I have created a custom loop using WP_Query to show posts associated to a custom post type I created. <?php $the_query = new WP_Query( array ( 'post_type' => 'scp_content' )); ?...
3
votes
2answers
18k views

ajax category filter

I know this is a big ask for you guys, but i can't seem to figure this out. I found this page : http://www.bobz.co/ajax-filter-posts-tag/#comment-28112 it shows how to make a dynamic filter for post ...