Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
10 views

When creating category, it creates automatically tag, or, when creating tag, it creates automatically category in same name

I have a weird problem. For example, when i create test category, worpdress is creating tag as test automatically. Or vice versa. I tried everything i know. 1) Disabled theme and plugins. 2) ...
0
votes
0answers
16 views

Show Posts from Specific Category as the Picture Layout Style

I am Trying to do a layout to show posts from specific category. like that picture: i can do in query. but when client create a category and wants to display a layout like the picture. is there any ...
0
votes
1answer
34 views

To display the category of a specific custom post type

I apologize for my English, but I am French. In my custom search page I display the results of my custom post type and everything is good. Only, I would like to display above the custom post type the ...
0
votes
0answers
13 views

How to select the parent category for child categories?

I would think if I select a child category, that the parent category would automatically be selected (with no choice to deselect the parent), but it's optional. Looking at how Wordpress sets up this ...
2
votes
1answer
34 views

How can I calculate the total number of categories at different hierarchy levels?

I'm trying to make a category counter, but it's not really working. I want to have a common counter of all categories (1168), which I would later display. For example: 1 category is the first level 6 ...
0
votes
0answers
14 views

Show categories not in gallery post format

I want to show all blog categories that aren't of type gallery. My code almost works but if I have 2 posts in the same category the category is shown twice ie: If I create a category called 'news' ...
0
votes
1answer
7 views

Woocommerce: Display an image on Products from a Specific Category?

Does anyone have code that can be added to functions.php that will allow me to display an image only on products that belong to a specific category? Preferably I'd like it to display over top of the ...
0
votes
1answer
12 views

Get posts in custom post type categories

I have a custom post type defined like so with taxonomies are standard categories: // Register Custom Post Type function custom_post_type() { $labels = array( 'name' => _x( '...
0
votes
2answers
17 views

Custom post type category not displaying category ID

I'm trying to get the category ID so I can call a loop query on only that category ID. However the following code returns null. Any ideas why? In the admin bar it shows edit category with an ID of 3, ...
0
votes
0answers
15 views

I want my category (archive) pages to mimic the structure/style of my Posts (home) page

Theme I'm using is easymag-pro. I will paste both pages below. I know I have to replace the archive.php with my home.php, but I need to add something to the new archive page so it will pull the posts ...
0
votes
0answers
14 views

How to use categories and tags widgets together?

Is it possible to use wordpress build in tags and categories widgets together? For example selecting first category and then tag showing only the posts that match both? I searched for some kind of ...
0
votes
1answer
16 views

Retrieving Categories based on the first character of the name

I was wondering how I can get information from the wp_list_categories object just using the first character of the category name. For example, I want to get the listing of categories based on the ...
0
votes
0answers
11 views

How to Enable Amp in category,taxonomy pages in wordpress?

I am new to AMP plugin in wordpress. Is there any way to implement AMP in category and taxonomy pages as well ? I had enabled posts in amp using template override method in themes in option "classic ...
1
vote
2answers
31 views

Assign category from custom field on post creation and update

I'm trying to hook on save_post to automatically assign a category (from a custom field) on post update and creation. Basically if the date event is 10/10/2020 - I want to assign the event to category ...
0
votes
0answers
13 views

Woocommerce Auto Add to Category based on parent category

I'm loosing my mind with one problem. We have that structure for Woocommerce Products Categories: Main category - Subcategory 1 - SubsubCategory1 - SubsubCategory2 - ...
0
votes
1answer
32 views

Add specific word before the category page title

in my site category page (archive page), the page title in browser is like this: My site | Site Description | Category title How i can add specific word befor all of category title. like: My site | ...
1
vote
2answers
25 views

Should the actual /category/ directory be 404? Is that normal WP behaviour

I'm not sure if this is 'normal' but on my WP install the actual directory for 'category' throws a 404 error. So, for example, if I had a category called 'apples' then every post or page associated ...
0
votes
1answer
18 views

Exclude posts in a category on one page but show those posts on a different page

We have a lot of blog post categories, and posts belonging to all but one category should show on the blog page. The other category should show on the Case Studies page. The solutions I've found make ...
0
votes
1answer
45 views

Template files not working for archives and categories

I added category-news.php template file to the theme directory but it doesn't apply the template of the category but instead to the index.php file. category-slug.php is the highest level of the ...
0
votes
1answer
26 views

Sticky posts not working when a specific category is set

I would like to show sticky posts at the top of an archive list for a specific category on the top page as well as on archive pages. I've been Googling for a working solution and found a few clues ...
-1
votes
1answer
19 views

Category pagination not working in category.php please help me

<div class="col-sm-8 main-content"> <div class="row"> <div class="col-sm-12"> <?php $cat_id = get_queried_object_id(); ...
0
votes
1answer
25 views

How to get featured image of last post in a category?

I have the following code and want to add a selected featured image $arg = array( 'orderby' => 'date', 'number' => 10, ); $categories = get_categories($arg); ...
0
votes
0answers
15 views

List current category children on form results that uses AJAX

Ok I will try to describe my problem as best as I can. I have a website with ad listings. On listings page there is a filter form which has categories list on the left that uses AJAX to print results ...
0
votes
0answers
18 views

Posts says they are uncategorized but they are not

With the latest WP Update it seems to be a bug in posts categories. Every posts says, in the frontend, that is uncategorized. Even if you go to every post it says “-” in the category column. BUT ...
0
votes
0answers
24 views

Add base category as a first dropdown item in a bootstrap based category menu with dropdowns

I'm using a wp_get_nav_menu_items filter to automaticaly add sub categories to a categories menu. here is the code : add_filter("wp_get_nav_menu_items", function ($items, $menu, $args) { if (...
0
votes
0answers
36 views

How to filter specific element of an array in wordpress/php?

I have a php code as shown below in which I have added Line#A for the debugging purpose. <div class="vidlist-main__meta cf"> <?php //if ( has_excerpt() ) {the_excerpt();} $tags =...
0
votes
0answers
21 views

MYSQL SQL syntax error on Wordpress Posts page

I see the following error on my Wordpress Posts page when I enable debugging. I only noticed this when I started adding categories to my posts and they were not saving. I never used categories before, ...
-1
votes
1answer
38 views

How to use acf field value to order category?

I am trying to order category by acf field value. How can I achieve this using acf filed value? $categories = get_categories('taxonomy=toc_category'); $sorted_cats = array(); foreach($...
0
votes
0answers
10 views

Help create shortcode get name and link of parent category and list subcategory of parent category and product of parent cat on woocommerce

Please help me create shortcode get name and link of parent category and list subcategory of parent category and product of parent cat on woocommerce I have code as function create_shortcode_product($...
0
votes
2answers
23 views

Get category's parent category while using get_the_category_list

I use get_the_category_list to create a cat link in the header of my posts in the archive page, like so : $categories_list = get_the_category_list( esc_html__( ', ', 'mytheme' ) ); if ( $...
0
votes
1answer
15 views

Why custom taxomony not showing when create a post?

I have created taxomony which are showing in wordpress Menubar in Post tab. But when i create a new post or edit my post it is not showing with categories. Can any one help me out that where i am ...
0
votes
2answers
44 views

Parent category / child category posts

Not sure if this is the best approach - so happy to change - but I've set up a number of categories with child categories. Then on my landing page I list the parent categories - I'm using ACF to ...
0
votes
0answers
8 views

How to add all products from one product category instantly?

I am configuring an e-commerce website that uses Woocommerce and the website sells individual items and collections of items. Is it possible to purchase a collection of items based off of it's product ...
0
votes
0answers
35 views

Display all posts by default, then use ajax filter on categories

I've got this in functions.php: add_action( 'wp_ajax_nopriv_load-filter', 'prefix_load_cat_posts' ); add_action( 'wp_ajax_load-filter', 'prefix_load_cat_posts' ); function ...
0
votes
0answers
14 views

get_categories set $args so only returns categories that lead to pages with results

We have a large filtering menu on our archive. However for a taxonomy we only want to list the filters if they return results instead of ending up on a '0 posts found' page. Is there a way to add ...
0
votes
0answers
17 views

Display more than one category on the post's featured image?

I've tried Google but can't find what I'm after. Can't find it here also! I've just added a new post to my wordpress site and I know I can add multiple categories, BUT, is it possible to add those ...
0
votes
0answers
22 views

Set a Default CPT taxonomy by taxonomy id

How can I set a default CPT taxonomy by taxonomy id? I don't want to do it by slug. Must be by ID.
0
votes
0answers
19 views

Woocommerce Category image full size

I'm using Woocommerce Version 3.5.6 WordPress : 5.1 I need to use Woocommerce category image in fullsize. But I can't do it 1/ products / display has been erased from Woocommerce 3.5.6 version 2/ ...
0
votes
1answer
21 views

Pass Wordpress variable to the next page

I would like to pass a category name into the next page. I'm using Session. In functions.php I added: function session_initialize() { if ( ! session_id() ) { session_start(); } } add_action( '...
0
votes
0answers
26 views

Get products with no category

I have some products with no categories on it. Even the category 'No Category' is not attached to them. Don't know how this is happend, maybe with an import with WP All Import. I want to get those ...
2
votes
1answer
40 views

get complex results set according to category structure

I need to get a complex result set from a WordPress database according to the category structure. First I will try to explain my category structure. I have three level structure as bellow. flight [...
0
votes
0answers
24 views

How to fix 404 error in pagination in categories of woocommerce with common url base /shop/?

I can’t find a solution — unification of url bases of products and categories in woocommerce. I have found only one working solution: In Settings -> Permalinks: Category base change on shop Custom ...
0
votes
1answer
18 views

How to display custom fields as table in Woocommerce

I imported around 7000 products into a WooCommerce project I'm working on, and each product has specifications, and I would like to display them in a table, like something you would see on Amazon for ...
0
votes
0answers
7 views

Woocommerce Category Attribute

I am working on a wordpress project with woocommerce. I am new to woocommerce and i need for my client to create some personalization of the admin panel, in order to make the website customization as ...
0
votes
2answers
19 views

problem with filter of custom portfolio categories

I have created a custom portfolio with the following code in the function.php in a custom template. if ( ! function_exists('custom_post_type_portafolio') ) { // Register Custom Post Type function ...
0
votes
1answer
39 views

WordPress alphabetical A-Z custom post type post result display

How to display WordPress custom post type result alphabetical letters or pagination? for a example i have a post type called "homeless". under homeless there are 50 states (categories). there are 259 ...
0
votes
0answers
17 views

make color of headline depend on category?

On my site I want the color of the category-headlines on the front page to be dependent on which category the post is. Is this possible?
0
votes
0answers
114 views

How to create a button to filter posts (list) by meta value

I have a category.php page that lists posts from each category. Above that list, I have three buttons. One that filters by title (asc), other by "most recent" and the third by "most viewed". I can ...
0
votes
0answers
20 views

I cant remove TAG from URL even in HTACCESS

i tried putting dot in permalinks (which is like 2012 fix) but it didnt work so i added that code to htaccess RewriteRule ^category(.+)$ http://example.com/$1 [R=301,L] RewriteRule ^tag(.+)$ http://...
0
votes
2answers
62 views

Custom color for each category name

I have tested several plugins and none is perfect solution. I would like to have simple solution so user can select the color for the Category name which will be the actual color of the text/link like ...