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

How to exit out of delete_categories and stop action?

I've set up my category where it has a term_meta 'author' in which the value is in the form of an array. All authors can see which categories they have in their backend but how do I make it so that if ...
0
votes
0answers
6 views

Post meta not working

I'm trying to set custom category and post meta but I think they are somehow blocking eachother. $post_tarjousid = wp_insert_post($post_tarjous); $category_id = 22; $taxonomy = ...
0
votes
1answer
9 views

Filtering blog posts by category

I'm pretty new to theme development, and trying to put together a new theme. On my site, I'd like to set up some categories for the various blog posts. Easy enough. Then, I'd like to provide the user ...
0
votes
1answer
14 views

How to add tags under categories

How to add specific tags under categories on Wordpress Main categories on my blog example.com/recipes example.com/fashion example.com/beauty example.com/life I want to add tags under this recipes ...
0
votes
0answers
11 views

Reset filter on category archive in wordpress

I have a wordpress website with several posts divided in categories. On the frontpage I have links to the category archives which will go to url .../archives/specificcategory/. Let's name the ...
0
votes
0answers
10 views

custom wp_list_categories in single.php

I have created a custom WordPress theme, and I am customizing my post page (single.php). I would like to display the parent and child categories and sub-child related to the post (wp_list_categories) ...
0
votes
0answers
16 views

How to display full portfolio URL pass including category and sub-category? [closed]

Custom permalink structure doesn't work for the WordPress portfolios. What I'm trying to achieve: mywebsite.com/portfolios/portfolio-category/portfolio-subcategory/portfolio-name What I have now: ...
0
votes
0answers
12 views

Wordpres category management

I would like to know, if it is possible to manage categories like how we do with atributes. I have about 500 categroy and subcategories and when I enter category section in admin dashboard, I see a ...
0
votes
0answers
10 views

Woocommerce - Get Product's Child Category Name or ID [closed]

I am trying to get the child-category ID or Tag ID for products. The code below is able to get the parent ID only and not the child ID. I believe from the code below that '$order->get_items() '...
0
votes
0answers
12 views

How do I edit the terms output args or array data?

This correctly prints the terms with images but the wrong order: <?php $terms = get_the_terms( $post->ID , 'wpsl_store_category' ); foreach ( $terms as $term ) { echo '<a href="'...
0
votes
0answers
36 views

Add a product category to a specific product via a button

I want to add a button to product page when those products are in the category"expire". This button has to add a category. I search on web a solution and I found a code. I modified this code ...
0
votes
0answers
7 views

How display related post only in Default category on single

I have a website with lot of post. I use 3 or more category for my post. I wanna display post only for the "default category". I try this one but work with all category not only Default. If ...
0
votes
0answers
15 views

how to show all posts of each category in pages

Although found many questions and answers about showing all posts in categories, I can't achieve this: Show all posts from each category in as many page as my sites glows. Let's says we have a site ...
0
votes
0answers
25 views

Custom Post Type same name as Category

I have a general question. I'm using the plugin Custom Post Type UI. I named one of my post types marketing. However, I named one of my categories marketing too prior to installing the plugin. My ...
0
votes
0answers
18 views

List sub categories and corresponding posts of a parent category

I'm looking to list my subcategories and related posts under a parent category page. For reference, I have 3 parent categories: Baby, Toddler and Preschool. The 'baby' category page WORKS with the ...
0
votes
1answer
52 views

Display a list of random terms from custom taxonomy with shortcode

I try to output a list of terms from my custom taxonomy. I am almost sure I was using this code snippet before, but somehow WP throws errors: shuffle() expects parameter 1 to be array array_slice() ...
0
votes
1answer
12 views

Rewrite with pagination /foo/page/2/ to posts of a given category, page 2

This add_action('init', function() { add_rewrite_rule('^foo', 'index.php?category_name=category1', 'top'); }); works and allows example.com/foo/ to display all the posts from category1. But then ...
1
vote
1answer
12 views

Issue adding sub category programmatically

i am trying to insert products from an array. The product is successfully created and the values are inserted normally except the sub-category. The issue here is that the subcategory is registered as ...
0
votes
1answer
15 views

Edit the_category (); for a hierarchical display

For my wp theme I want to use the categories as tags on my posts. Example: The problem is that the category in red must always be the parent and in gold the child. Except that returns the categories ...
0
votes
0answers
6 views

Different post slug based on archive

I need some help with my current WordPress site. The site got 6 post categories. Posts can have multiple of these categories. The slug of the posts include the category slug. For each of the ...
0
votes
1answer
21 views

How to get the last category name of a child category?

there. I've tried tons of solutions I've found in this forum before asking this. It's kind of hard for me to understand the php sintaxe. I have no idea how to do this and i've been stuck for days ...
0
votes
1answer
19 views

ACF date picker to trigger category change

I have a ACF date picker that currently changes the post status from “Publish” to “Draft. Yet I am also trying to change the post category. If anyone can point me in the right direction, that would be ...
0
votes
0answers
11 views

Category panel does not open/show fully in block editor

A client, who has a site built in a builder-type theme, contacted me with an interesting problem. " "Categories" is there, but when I click the arrow to get the list, there isn't one.&...
0
votes
0answers
28 views

Add a "custom field" to a category that can be retrieved when viewing the category page with get_post_meta

I usually set a custom field customdata for posts and pages, that I can obtain when rendering a page with this PHP code: get_post_meta(get_the_ID(), 'customdata', true) Is there a way to set a custom ...
0
votes
0answers
16 views

Problem creating wp categories

I have a wordpress site and it doesn't let me create categories and tags. What would be the problem? After creating it appears but it doesn't let me save anything in that category and I don't delete ...
0
votes
0answers
9 views

Change category thumbnail size

I have my whole page thumbnails set as 331x331px but somehow all category thumbnail showing 300x300px. Which makes the picture quality quite bad due to CDN automatic resizing. I tried all the settings ...
0
votes
0answers
22 views

Allow two posts (from different categories) to have the same slug

My permalink structure is /%category%/%postname%. How to allow two blog posts, of permalinks /categ1/myarticle and /categ2/myarticle to have the same slug myarticle? When I try to change the permalink,...
0
votes
0answers
33 views

category description not showing in my woocommerce

I want to show the category description on my categories pages but I can't access the category.php file and I am using too many plugins already, I don't want to use one more plugin for this. Please ...
1
vote
0answers
14 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
28 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
34 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
19 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
1answer
22 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
37 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/...
1
vote
1answer
23 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
24 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
102 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
13 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
19 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
9 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
51 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
43 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 '...

1
2 3 4 5
94