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
0
votes
0answers
4 views

One Specific Category To Permalink

I have a Wordpress site that has been up and running for some years using the custom permalink structure of: /%postname%/ This is fine, except I want to launch a special section in which posts go in a ...
0
votes
1answer
23 views

List of post categories only associated to another custom taxonomy

I've got a custom taxonomy "sector" associated to posts; posts are assigned to the default categories as well. What I'd like to achieve is to show in a custom sidebar a list of "...
0
votes
1answer
25 views

JSON REST API Wordpress only showing first 10 categories

Alphabetically ordered categories are shown first (first 10). If I try to show all categories in JSON / Wordpress, it's not showing it. So, imagine these are the categories: A B C D E F G H I J K (=10)...
0
votes
0answers
13 views

Get main parent category for post (WordPress/Advanced Custom Fields)

I am working with a custom category taxonomy field named ‘category-tax’ in WordPress using Advanced Custom Fields. I am trying to have the main parent category be a button for all parent and child ...
0
votes
0answers
9 views

Compra por categorías [closed]

Buenos días tengo el siguiente código que me permite que mis productos compren solo en una categoría: function is_product_the_same_cat($valid, $product_id, $quantity) { global $woocommerce; ...
0
votes
1answer
15 views

A different permalink structure for different categories

My Settings > Permalinks is set to /%category%/%postname%/. Thus blog posts have URLs like example.com/category12/article1. I would like to keep this permalink structure for most articles. Which ...
0
votes
0answers
31 views

Custom post type archive page filters

What is the proper way to filter my custom post type archive page by my custom taxonomies? When i go to archive page(archive-recipies.php), fetch me all the post under the custom post type. In this ...
0
votes
0answers
15 views

OK to redirect the root WordPress category slug?

In my new WordPress site, I've started using parent and child categories, so that I've begun to have working links of this sort: https://www.example.com/category/photography/ https://www.example.com/...
0
votes
0answers
9 views

WooCommerce- Fetch Thumbnail From All Products

Using the answer from this question I am able to fetch all Categories with all products. How can I also include the image thumbnails for each product? $args = array( 'number' => $number, ...
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
21 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
100 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
23 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
23 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
1answer
39 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
51 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
57 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
30 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
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/...
0
votes
1answer
23 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
76 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
43 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. ...

1
2 3 4 5
94