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
0 answers
5 views

Need checkbox option within the dropdown filter [closed]

I have created a custom post type with the Jet Engine plugin and used the Jet Filter plugin for post filtering, which provides a dropdown or check filter. However, I need a checkbox option within the ...
suganth's user avatar
0 votes
0 answers
15 views

Trouble Fetching Posts Using WordPress API: No Response from Specific Category

I'm facing difficulties while retrieving posts via the WordPress API, specifically when attempting to fetch posts from a particular category. Here's the issue in detail: Fetching Posts by Category: ...
Leead's user avatar
  • 1
0 votes
0 answers
10 views

exclude certain categories from the list at the end of the blog post

I'm trying to achieve the same as the OP here using the same structure (), viz I simply want to exclude certain categories from being displayed in the 'filed under' list at the end of a blog post. ...
CatLady's user avatar
0 votes
1 answer
7 views

Fetch Post Category

How to fetch all post categories which has posts and show in a drop down list in WordPress Admin panel ?
Foysal's user avatar
  • 449
0 votes
0 answers
6 views

How to get the proper category in permalink with custom post type assigned to multiple categories

I was wondering if you could help me with the following issue. I have read a lot of cases, but couldn't trace anywhere good answer which explain, how this works. I created a custom post type: project ...
Brango's user avatar
  • 1
0 votes
1 answer
23 views

How to get a list of all posts and their categories?

Basically I just need to have a table like this: Post title Categories Post 1 Category 1, Category 2 Post 2 Category 2, Category 2.1 ... ... From MySQL Query to Retrieve Category from wp_posts I ...
Ooker's user avatar
  • 332
0 votes
1 answer
23 views

Error counting posts of category

On a WP page we are counting and displaying the amount of posts for all categories. Meaning, all sub category posts should be counted as posts for the main category. Let's say, the name of the main ...
JonSnow's user avatar
  • 115
1 vote
0 answers
12 views

When using get_terms with hide_empty = true, terms that only contain scheduled posts are not returned. How to override this?

My code is simply: $cats = get_terms( [ 'taxonomy' => 'category', ], ); Obviously, hide_empty is true by default. There's a category that only contains scheduled posts and it's not ...
William Beaumont's user avatar
0 votes
1 answer
26 views

Pull total post count for child category and parent if term ID

I have a mess of code that works, however I know its a mess and im sure there is a neater way of doing this. I am trying to get the child category to display under the parent category and for the post ...
Beep's user avatar
  • 29
0 votes
2 answers
28 views

Count post with tags within one category?

I have a code that counts how many posts I have in with certain tags, is it possible to add the functions to count how many posts I have with a certain tag that's in a particularly category called &...
Adam Larsson's user avatar
0 votes
1 answer
18 views

Remove product meta from single product page

I wanna remove product meta(sku, category) from single product page. I tried different codes but nothing work. I am providing a code remove_action( ‘woocommerce_single_product_summary’, ‘...
Tuba Saif's user avatar
0 votes
0 answers
16 views

Can't change WordPress / WooCommerce attribute value order

I'm making a website/webstore in WordPress/WooCommerce and ran into a problem with product attributes and swatches. We sell engraving materials (layered sheets) with a lot of different colors. So I ...
user23495269's user avatar
1 vote
0 answers
8 views

Wordpress menu disappears in category pages

I have a custom query to order and display posts in my functions.php, and I noticed that the navigation menu disappear in those categories! function my_filtro_ed_ordine( $query ) { if ( ...
Arianna's user avatar
  • 11
0 votes
0 answers
9 views

How to best assign choices to CPT posts and allow filtering on frontend

Looking for suggestions on how best to achieve my goals for assigning filters to posts and using those when searching for service providers. I have created a CPT: Service Providers I want to allow ...
php-b-grader's user avatar
0 votes
0 answers
33 views

How to only show sub-categories of current category (FSE, block editor)

On my Categories archive pages, I'd like to show the subcategories of the current category. This is with Twenty Twenty Three (Full Site Editing theme) and block editor, so I'm looking for a block ...
Audun Myhra Bergwitz's user avatar
0 votes
0 answers
6 views

child category under correct parent

I have a side bar that is showing my custom post type categories and sub categories, its build to show categories and the child if not present in the current custom post type as categories is used ...
Beep's user avatar
  • 29
0 votes
1 answer
31 views

How to get parent and child sub category (Taxonomy) order to display

Trying to get my list of categories to display the child after the parent. For Example Parent Category Child Category child category Parent Category child category Current code <aside ...
Beep's user avatar
  • 29
0 votes
2 answers
43 views

Show category only if post type is post_three

How can i only show categories if post type is "post_three" <aside class="sidebar"> <div class="widget widget-filter"> ...
Beep's user avatar
  • 29
0 votes
1 answer
66 views

Custom post type category pages pagination returns 404

I currently have the main posts archive page at /blog/ (custom permalink structure of /blog/%postname%/) and categories at /blog/category/ (categories base left empty so it defaults to this). I have a ...
ajs_app's user avatar
  • 15
1 vote
1 answer
91 views

Is there a standard "Archive" block that shows ALL posts from a specified category?

What I have: I'm running a website (on newest WP 6.4.3) that has three distinct categories, and blog posts for each category. Each post specifies this category, and I have hundreds of posts total. I ...
Torben Gundtofte-Bruun's user avatar
1 vote
1 answer
40 views

How to check if the post exists in any of the categories?

What I am doing is, I have to check if the post exists in any of the categories or not. I have tried below two codes but it's not working for me. This is the first code foreach ($scats as $key => $...
Naren Verma's user avatar
0 votes
2 answers
40 views

Override categories with Pages (block theme)

It seems to be a common question as to how to override an auto-generated category page with a manually-created Page when both exist at the same location for example, /xxxx/ and /yyyy/ and /zzzz/ are ...
Displayname71's user avatar
0 votes
0 answers
17 views

Products showing up in subcategory when they shouldn't

I have a problem where the website shows the subcategorys but also the products on the next page just like in this image you see the sub categorys but theres a second page that shows products that ...
Sn1ck's user avatar
  • 1
0 votes
0 answers
12 views

Need a Category List for the category slug

I am not sure I explained this right but for my main category slug I would like a list of all my categories. So when someone goes to https://mojiedit.com/category/ for example, it will present a ...
Kevin's user avatar
  • 1
0 votes
1 answer
102 views

Adding 400 product categories with their hierarchy to a navigation menu

I've been trying to figure out a way to bulk add all the product categories from WooCommerce without having to add them manually through Appearance -> Menu. I need their hierarchy to follow but I ...
commparlimage1's user avatar
0 votes
0 answers
20 views

Category and tags are not working properly

When click on cateory or tag they diplaying all posts in the every category but every categpry have different posts.Please help how to fix this. Using Blockkit Corporate Theme
Naeem Khan's user avatar
0 votes
2 answers
79 views

Categories Not Showing in breadcrumbs in posts

I’d like to get the breadcrumbs to show the category path on single posts. On the subcategory pages, I’ve got Blog>Category>Subcategory which is perfect. Example here: https://mechanicalmentor....
Micheal Kean's user avatar
0 votes
0 answers
49 views

How can I disable links for categories but keep showing them on my blog in an Elementor Template?

I have a website with blogs, I am displaying categories on the blog using Elementor but the categories generate its respective link. <ul class="elementor-inline-items elementor-icon-list-...
Manav Mehta's user avatar
2 votes
0 answers
67 views

How to make query loop block dynamic

I am looking for a tutorial to figure out how to set the query loop block to get its category from the post it is in so I only set it in single post template not in every post I wanna create. Is that ...
Poorya Ghorbani's user avatar
0 votes
1 answer
43 views

why same category base and single post base don't work?

I have checked a similar question on the site but there was no satisfactory answer? Here is what I would like to accomplish. When I set the permalink structure to '/blog/%postname%/' this gives me the ...
yucelm's user avatar
  • 3
0 votes
0 answers
49 views

Display featured posts first, then display all others within a specific category in WordPress

I want to display featured posts first, then all other posts not marked as featured on a category archive page. I am using a plugin that has functionality to mark posts as featured. I have figured out ...
user1462's user avatar
  • 1,284
0 votes
0 answers
25 views

How To Remove Parent Category from Child Category URL?

Are there no easy way to ensure that the permalinks only have the lowest child-category listed? Do I really need to install a plugin for this or make custom code? I already use RankMath to strip the ...
Kasper Toft Braun's user avatar
-1 votes
1 answer
64 views

Add taxonomy or category slug to custom post types URL

I have created a custom plugin that is similar to Woocommerce but will only manage products that are loaded using the WP REST API in a Vue SPA. I've registered two custom post types, one for products ...
ICTDEV's user avatar
  • 123
0 votes
1 answer
17 views

WP Query filtering by custom category not showing all relevant posts

Here's a question I've been trying to solve all day: I added a WP Query that would show posts from a category that the admin chooses with a custom field. The post is a custom post type called "...
Jillian Hoenig's user avatar
0 votes
1 answer
15 views

Adding content to the top of post's based on their category

I'm trying, but struggling to add a specific div to the top of a post, based on the category it is assigned. For example, at the top of the content, if it's tagged with 'basketball' I want to add ...
shakeshack's user avatar
0 votes
0 answers
83 views

How to edit category/archive page?

Basically I want to customize this page to make it look like this page, however I can only edit text over the featured image with my theme. Is there a way to edit the category/archive page (sorry for ...
Cullen's user avatar
  • 1
0 votes
1 answer
39 views

Show posts assigned to multiple categories in current category page

Whenever I assign a post to multiple categories, the Wordpress website just loads posts from Cat1 only. No error message. My post-assignment method: Post1 - Cat1 Post2 - Cat2 Post3 - Cat1,Cat3,Cat4 ...
user3362364's user avatar
0 votes
1 answer
39 views

Show category name in category.php when posts assigned to multiple categories

I'm trying to show the category name in my category.php but it's not working when I have posts assigned to multiple categories as it chooses the first category. <h1><?php $cat = ...
user3362364's user avatar
1 vote
1 answer
15 views

How do we ReWrite HTACCESS to point a cat/subcat Product URL, to Cat/ only?

We have a problem where a site has got some odd URLs indexed by Google. This is the incorrect path: example.com/shop/mens/jeans/jean-product/ This is the correct path: example.com/shop/mens/jean-...
Simon_a6's user avatar
0 votes
0 answers
17 views

Category archive page redirects to home page

I have a multisite setup, any attempt to load /category/news or suchlike simply redirects to the home page. This is true for all categories. in the case of the main sub-site it appends /wordpress (...
Chris Pink's user avatar
0 votes
0 answers
13 views

WP-PageNavi not working on category.php

It is working in another page I created where it shows all the posts, but not in category.php, where it shows only the posts of the specified category. It only shows the first page, the second onward ...
Now Playing's user avatar
0 votes
0 answers
9 views

How to query by subcategory and, if there are fewer than 10 posts in that subcategory, fill out with posts from parent category

I want to query all posts by subcategory and, if there are less than 10 posts in that subcategory, I want to return posts from the parent. If there are still not 10 posts, I want to fill out the ...
user18102663's user avatar
0 votes
1 answer
12 views

change the listing type of categories block?

How ist it possible to display the categories in the sidebar ( cat. block ) like this: cat1, cat2, cat3 cat4, cat5, cat6 and NOT cat1 cat2 cat3 cat4 cat5 cat6 Can you help ? THANKS in adv. best wishes
John Mclaine's user avatar
0 votes
0 answers
12 views

Query for posts belonging to multiple categories

Within the default Post categories I have A parent category Cities -- City A -- City B -- City C A parent category Beauty -- Hairdressers -- Pedicure A parent category Sightseeing -- Archeological -...
Brecht Schoeters's user avatar
1 vote
1 answer
75 views

Using same term for slug and category

I am having problems with a site that uses the category “vacatures” for posts. The “Vacatures” page, lists those posts. Some time ago the client has made a page called “vacatures” and replaced the old ...
andre's user avatar
  • 21
1 vote
0 answers
420 views

Wordpress Custom Post Type Archive, filter by category and get pagination working

I have created 9 different Custom Post Types via ACF and an assortment of custom field blocks for 8 of them. Those 8 are used to create different content, based on requirements for each post type. The ...
Mitch S's user avatar
  • 27
0 votes
0 answers
97 views

Python rest api post article, update problem

I searched about how to post new article by python. and it worked. Here is sample of my code res = requests.post(urljoin(WP_URL, "/wp-json/wp/v2/posts"), data=json.dumps(...
신동혁's user avatar
0 votes
0 answers
13 views

Category display using conditions

I have a custom post type(events) created and has taxonomy(event-categories) with parent and child categories. Since im not good in coding, i will try to understand all the help from here. So what im ...
Bordzee's user avatar
0 votes
1 answer
74 views

Exclude category in widget through child theme

I desperately try to exclude categories through following snippet in my functions.php of my child theme: <?php //https://developer.wordpress.org/themes/advanced-topics/child-themes/#how-to-create-a-...
Rob's user avatar
  • 1
0 votes
0 answers
14 views

Separate archive template to show posts and CPT by same category/taxonomy

I have archives for posts and another for reviews which are working fine, try as I might though I'm struggling to have a separate archive under the URL /content/[category] that pulls both posts and ...
james's user avatar
  • 1

1
2 3 4 5
97