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
1
vote
1answer
21 views

Wordpress category page redirects in .htaccess not working

Wordpress automatically generates category pages, for example: https://planthardware.com/category/microgreens/recommended-equipment/ I want to redirect this to a custom page, for example: https://...
0
votes
1answer
18 views

Add $args to wp_list_categories

I'm trying to add an argument to wp_list_categories of the Categories Widget: function cat_list_show_all( $list, $args ) { $args['show_option_all'] = __( 'All Cateogries', 'textDomain' ) . '<...
0
votes
3answers
95 views

Show subChild categories

Targets : Show Locations (sub-districts & cities) on the customized shop page & on tab additional information - Show on line 5 I'm building a property site using wordpress and woocommerce. In ...
0
votes
0answers
17 views

Dropdown category field inside repeatable metabox

I'm building a repeatable metabox with different fields in the Page editor: Name, Email, Tag, Categories. To display the dropdown category field inside the metabox I use wp_dropdown_categories(); The ...
0
votes
1answer
22 views

Display all subcategories from parent category

I have 20 subcategories from a parent category, and they are like that Parent September November … up to 20 Here is the code that try it to display, but I get only 1 category instead <?php $...
0
votes
1answer
14 views

Category title output before opening title tag

I am using this code to add the category title to the category archive titles: function filter_events_title( $title ) { // Single venues if ( tribe_is_venue() ) { $title = sprintf('%1$s ...
0
votes
0answers
11 views

How to hide a category or tag everywhere EXCEPT for use with get_posts

I am using categories for very short posts (2-3 lines). These posts don't have much value in themseleves, however I use them to setup a complex home page where I have very small sections of content ...
0
votes
0answers
10 views

Visual composer custom element error

I am creating a custom element where I need to load woo-commerce product categories as dropdown (in visual composer element edit option) but I am getting this error. can someone tell me where is the ...
0
votes
1answer
16 views

Stores category posts in an array

I'm trying to get my posts from my category.php file. The loop works fine, it's showing my custom post types, but I'd like to store the posts from my category to reorder them in a certain way. How do ...
0
votes
0answers
18 views

get category in list of posts // shortcode for custom related posts

i am looking for a solution to get the category of the related post. I created a shortcode (@buttered_toast helped me, thanks for that) that can be inserted in a post. This shows custom IDs/posts. It ...
0
votes
0answers
7 views

Show parent category wp_list_categories wordpress

For example I have 3 categories: cars, bikes, trucks The category of track has 3 subcategories (childs): man, scania, iveco I want to show on page only subcategories of track category. How can i do ...
0
votes
0answers
13 views

Add Post Categories in Post Tags Field Programmatically

Is it possible to add post Categories values in post tags meta field automatically after saving/publishing post. Means i added "File Manager" and "Tools" category in post then the ...
0
votes
1answer
22 views

List taxonomy terms assigned to a post in hierarchical view

Been trying do this and still no luck. What I'm trying is to list taxonomy terms assigned to a post ordered by parent-child category relationship (hierarchical view). Structure is something like this ...
1
vote
0answers
41 views

Solution for ascending order in a category

In order to have posts in ascending order in a specific category, I inserted the following string in function file: function reverse_order($query) { if(!is_admin() && $query->is_main_query()...
0
votes
0answers
5 views

How can I get individual menu items to hover over in different colours? They need to relate to their specific category colour [closed]

I'm building a wordpress website with Elementor Pro, but i'm struggling to get the individual menu items to hover different colours on the top bar - the dropdown menu works fine. I can change them ...
0
votes
1answer
34 views

Return all Tags and Categories in Separate List

I am using the snippet below to create a shortcode to get all tags for a search in a separate list including tag count. Eg search for 'foo' and it returns all tags for all posts that match the search '...
0
votes
0answers
14 views

Is there a way to categorize a list posts all at once?

We are going through a re-categorization of our blog and need to migrate our posts from the current taxonomy to an entirely new one. Is there a way, either through a plugin or FTP to recategorize the ...
0
votes
1answer
50 views

How to obtain the recent posts without their content in an efficient way?

It would be great to make a single DB request but I don't know how to do that either. I have this code and it works but I want to change it to be more efficient: $cs = get_categories(array( '...
0
votes
1answer
22 views

How to show related posts of category on post within custom posttype

We created a custom posttype called 'Handbook' and it has its own categories. Inside this handbook-category we have categories like 'fase 1', 'fase 2' etc. All the posts in this posttype got one of ...
0
votes
0answers
15 views

Why in the e-mail notification about a new post published, the category of the post is always: Uncategorized

I need a function for sent e-mail notifications to users when a new post is published on the blog. I used transition_post_status and it works well. But I need to show the user in which category the ...
0
votes
1answer
13 views

How do I remove “Uncategorized” from my theme on my posts page?

How would I remove “Uncategorized” on my posts page and replace it with some of the other topics I discuss on my blog? I use the “Calm Blog” theme from Craft Themes (wordpress.org).
0
votes
0answers
40 views

How Can I Use Equal And Question Mark In Category Slug?

I need to add a question mark and equal the category url. I need this: site.com/stack?exchange=ask But Wordpress does not allow specific characters in url. So i tried to use html encodes in category ...
0
votes
2answers
54 views

Get nice name of category from slug (remove dashes of category)

I have a function in a theme: $category = isset($_GET['category']) ? wp_unslash($_GET['category']) : ''; The problem is that it outputs my categories like this: "test-category" I want, ...
0
votes
0answers
16 views

How to remove category name for only one category?

My current WP config looks like this: in permalink setting Custom Structure set to /%category%/%postname%/ Category base set to . My question is: how to remove category name for only one category IE: ...
0
votes
2answers
29 views

Conditional label Woocommerce archive [unsolved]

I'm building a webshop with Wordpress and Woocommerce. On the productoverview (archive) of a productcategories I want to show a label if the product has the category 'New'. The following code works on ...
0
votes
2answers
26 views

How to redirect to category page if page does not exists?

In my current case, the system try to find a page and show 404 if it does not find. I would like with the same url... like https://example.com/{{slug}}/ Check if a page with this slug exists : Yes - ...
0
votes
1answer
22 views

Change the name Category - Not change category name

My client has a Law Firm, and he is asking if we can change the term CATEGORIES to JURISDICTION. (I tried to explain that he could create a new category called "jurisdiction", but that is ...
0
votes
1answer
15 views

Display Visual Composer shortcode if a post belongs in specific categories

I have a PHP template file that requires some Visual Composer shortcode to be added. I only want the shortcode to display if a post belongs to certain categories. At any one time, at least three child ...
0
votes
0answers
35 views

Make all posts of a category to only appear on the sidebar of that particular page

I have created a top navigation menu based on categories and assigned all posts to different categories. What I want is for each "page" to only show posts from that category. For example I ...
0
votes
0answers
17 views

Php snippet for importing products matching with categories

I use an import plugin to update my WooCommerce products from an XML file, when I used to have Primary Categories and limited to 1 Child Categories I used a small php snippet to match the category ...
0
votes
1answer
24 views

Display posts by alphabetical order

I just purchased a WordPress theme. I’m trying to sort post on one category into an alphabetical listing (glossary type of listing). Example : https://www.udiscovermusic.com/browse-artists/ There are ...
0
votes
0answers
23 views

Custom url parameters for wp categories

I want to generate custom url for wp post categories. Example: Categories structure is as following: Cat1 |_Cat2 |_ Cat3 WordPress generates the following url structure for categories: //host/...
1
vote
1answer
22 views

View post with specific category id and name which I selected in the backend (drop-down option)

I'm trying to get the category ID from Kirki Function and then pass the ID into a loop to get View all posts from that specific category id with name. I write this code at the backend: Kirki::...
0
votes
2answers
44 views

Get parent category field from child category [closed]

I'm using ACF to add categories color. I display them in the articles loop. I would like to retrieve the parent category color if the child color is empty. If the parent is also empty, get the primary ...
0
votes
1answer
59 views

How can i change sort category view starting from child then parent, not alphabetically

I have created categories by city and districts. On the archive page, it displays well. The problem is, the views are sorted alphabetically. As a example : City (Jakarta) Districts 1 (Tebet) ...
0
votes
1answer
22 views

Page category filter in admin dashboard

I created page category by this way ( or custom taxonomy with the help of ACF Extended Plugin). It works. Now I can add pages into category. My problem is that, I can not filter pages by category in ...
0
votes
0answers
9 views

Convert WP categories to product categories

I am in the process of converting posts to products. I can use the post type switcher plugin for this, however the posts are in many different categories and I want to also convert those normal post ...
0
votes
0answers
75 views

How to show the clicked category related posts on category detail page?

I have used a custom page using this code, these links redirect to Category detail page which showing "Nothing Found". How can I show the clicked category related posts on category detail ...
0
votes
0answers
9 views

Link to blog home page in category list

This is a follow up to Exclude a category from the filed under list only on some templates I'm curious now how I would insert a link in the list of categories to add a link to the blog home page? In ...
0
votes
1answer
40 views

Sort categories by custom field in WordPress admin

I know there are a lot of threads about similar issues, but I can't figure out why my custom sort won't work in the category admin page. Here is my code to add the ACF field as a column to the ...
1
vote
1answer
15 views

Why do my categories redirect?

When I create a new category I can't open it on my website and instead it redirects to another one called 'Macedonia' E.g. I made a new category called food but when I open the link http://...
0
votes
1answer
18 views

How can I display image child category in parent

This code work perfect, but I want to show child image too. I use ACF plugin. Can you help me please? $term = get_queried_object(); $children = get_terms( $term->taxonomy, array( 'parent' =...
0
votes
0answers
15 views

Permalinks settings: Post category page keeps redirecting to a page

WP version: 5.7.1 Web server: nginx Plugins: deactivated I am trying to get to a certain permalink structure, that an SEO agency is advising me to use. Looks quite simple, but I can't get it to work. ...
0
votes
0answers
31 views

How to make a custom category archive page display names for each of terms when displaying a page showing more than one

I have a custom page for a specific custom category which was derived from archive.php. On this page I have a "Search and Filter" (plugin) set of checkboxes which allows for a selection of ...
0
votes
0answers
25 views

Products category search not working

I am trying to implement a product category search. Here is my searchform.php Here is the image of what I intent to achieve <form id="searchform" method="get" action="<?...
0
votes
0answers
19 views

Wordpress Pagination not working on category sites

I'm totally frustrated and troubled by a stupid pagination error on my wordpress site. I'm currently building a portfolio page for my graphic work. I'm not into web dev that much but I managed to fix ...
0
votes
0answers
24 views

Searching in multiple category + URL hierarchy in real estate WordPress site

I'm doing a project, which reminds a lot like every other real estate site. The site provides information from different buildings (we shall call them now on). On landing page we have a search form, ...
0
votes
0answers
23 views

Max number of terms in a taxonomy?

I need to create a taxonomy (or maybe I will use the standard post category one) with more than 13000 terms. In addition, the terms will be translated with WPML. Can this number cause a problem for ...
0
votes
0answers
47 views

How to display the category name in the tab and post inside the tab in Wordpress?

I am using the bootstrap nav tab. What I am doing is, I have a custom post type and I have created the custom category. I have 8 categories and each category has 10 posts. I have to display the ...
0
votes
0answers
11 views

Posts arranged by Sub Category in Category page, But not showing non Sub category items

I'm trying to create Category posts under each sub category, that's working but With out sub category items not showing... <?php $categories = get_categories('child_of='.get_queried_object()-&...

1
2 3 4 5
94