Skip to main content

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

Hide product categories if empty by leaving them positioned in the same place in the menu

Hello, I integrated this same code to hide a category when it is empty and it works well. But I would like it to be positioned in the same place when a product is added again. Today, it is positioned ...
Val Mer's user avatar
0 votes
2 answers
27 views

category id (term_id) in url instead of slug

For a certain Wordpress shop with woocommerce we need the url to display the category id (term_id) instead of the normal slug with the category name. So instead of www.website.com/categoryname/ it ...
Martin's user avatar
  • 1
0 votes
0 answers
10 views

Prevent posts assigned to sub-categories being accessible also through top category URL

I have set up a fresh WordPress setup and added three categories. For the sake of my question, let's say that the top-catgory is named "World" and the two sub-categories are "Germany&...
Toby's user avatar
  • 13
0 votes
0 answers
12 views

Category and archive issue

Help, please. I have 4 category pages. When I publish a post on a specific category page it shows on all category pages after creating an archive page. But I want specific archive page for specific ...
Murad's user avatar
  • 1
0 votes
2 answers
34 views

I am looking for a function to create category links in the wordpress loop for articles

For several days I have been trying to create a link for the categories, basically they are displayed but are not clickable to access the categories page. Do you have a solution or a function to put ...
gestionlydie-tv's user avatar
0 votes
0 answers
17 views

Organizing pages into different categories/sections

The solutions I found seem a little inelegant and involve using additional plugins to use post categories for evergreen pages, which I think would make a mess of the blog section and confuse the posts ...
Alex's user avatar
  • 1
0 votes
0 answers
17 views

Display last category child in permalink

I have a travel blog with multiple categories and subcategories and I'm trying to find/create some code to include on my functions.php file so the permalink only contains the last nested subcategory ...
Diego EPDV's user avatar
0 votes
0 answers
65 views

Elementor : display only one category in loop grid

I'm having some issues with the loop grid in Elementor. I have two categories on my website and created two loop grids. I want to display only one category in each loop grid so I used some CSS to my ...
Laura's user avatar
  • 1
0 votes
0 answers
36 views

How can I filter Query Loop to show only posts in current category?

I am migrating a site from a page builder to a block theme. In my main post template I want to list other posts in the same category as the current post, excluding the current post itself. In the page ...
J Glasshalfpool's user avatar
0 votes
0 answers
16 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
13 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
10 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
12 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
31 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
35 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
14 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
29 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
32 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
32 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
26 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
9 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
40 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
7 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
56 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
44 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
79 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
146 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
63 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
73 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
225 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
22 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
146 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
53 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
81 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
123 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
50 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,294
0 votes
0 answers
32 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
170 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 ...
OHICT's user avatar
  • 133
0 votes
1 answer
18 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
105 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
44 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
69 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
16 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
22 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
14 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
10 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

1
2 3 4 5
97