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

Menu dropdown: dynamically list all posts for category

Situation: I have a wordpress installation where I have two categories: category a category b Now I have several posts which are either category a or b: post 1 -> category a post 2 -> ...
0
votes
1answer
9 views

Get multiple category names from permalink

I am trying to get category names for the ones that are available in permalink. e.g. I have the following permalink structure. abc.com/product-category/category-1/category-2/ Where as category-1 and ...
0
votes
0answers
11 views

Order category in shop page

i have this function to order for category the shop page in woocomerce function so_27975262_product_query( $q ){ //$q->set( 'category__in', array(96,105,97) ); if( !is_product_category() ) { ...
0
votes
0answers
6 views

Product and Category Translation [closed]

I build wordpress Woocommerce Website . I use Loco Translation and Polylang (free Plugin) together for translations But Translation for Product and Categorie not available . is there any idea . if not ...
0
votes
0answers
18 views

Two categories in permalink with both posts

I'm wondering if it is possible to achieve this goal: I have two different categories I want to show in an archive page, both posts for each category. My question is: is it possible to have a url ...
0
votes
1answer
13 views

Show testimonials based on post category matching product name

I have a template section that displays testimonials. The testimonials have been set up as a post type and will be given categories to match product names. Here is the testimonial section: <div ...
0
votes
0answers
12 views

get_categories() retrive post_tag instead category

I want to rewrite my category to a specific URL. but I get post_tag instead of category when I use get_categories(). Here my code add_filter( 'category_rewrite_rules', '...
0
votes
0answers
19 views

Display 10 popular tags of custom posts of curent custom taxonomy term

I want to display 10 popular tags in current taxonomy. ok i can display popular tags of total tags but i need to display tags (with post count) of custom posts of current custom taxonomy term. please ...
0
votes
1answer
23 views

Why title_li ='' not working

I want to hide the 'Categories' and used the following code <?php $args = array( 'parent' => 33, 'show_count' ...
0
votes
0answers
10 views

Price shows up double at Product Page

I'm currently working on a shop for myself. I have a question about a single product list. In the image shown the price shows up double. The first one is the regular one from WooCommerce. I looked up ...
0
votes
0answers
8 views

Sub menu does not appear in mobile menu [closed]

I have an issue concerning the sub-menu that I just created in WP. I am getting it on desktop version but not on mobile (hamburger menu). Any ideas why this could be/how to solve it?
0
votes
0answers
4 views

Search in custom post type AND in pages with category

I have a search field that's searching in my custom post type bwps with a hidden input: <form class="search-form form-inline" action="<?php echo site_url('/'); ?>" method=&...
0
votes
0answers
5 views

Unable to click on name and email box in comment session of my website and category archive title is showing in my category pages how can I remove it

https://exploreviotech.com/digital-marketing-a-new-platform-to-expand-your-business/ here is a link from my website you can check this issue in the comment box and here is the link of my category page ...
0
votes
0answers
12 views

Next post in same category

On my WordPress homepage (undersolen.no) I am using the latest post widget to show posts from one category, and want the arrows at the bottom of the post to show next/previous posts in same category ...
0
votes
1answer
13 views

Why is URL Slug Saving Differently From How It's Been Defined?

When editing this page in the dashboard, I've defined the URL slug as ft-lauderdale. Also, the title of the page is 'Ft. Lauderdale', and the slug in Yoast is ft-lauderdale: However, when I view this ...
0
votes
1answer
24 views

How can I display tags as categories?

I'm using the "Pages with category and tag" plugin because my website uses individual long pages as posts. I would like to make a gallery of the past posts (sort of like an archive section), ...
0
votes
0answers
14 views

Trying to get categories and sub-category listing

I am trying to implement this: The problem is I am not getting the expected output after selecting categories/sub-categories from the dropdown list. I know I have messed up and I don't know what I ...
0
votes
0answers
11 views

Media Library category only visible for admin role / specific admin

I am new in plugin development so sorry if my question is stupid. My plan is that a specific media library category is only visible for admin users (or maybe a specific admin user). All other roles ...
0
votes
0answers
9 views

Shop Category Pages missing <h1>s

My website is using Future Life theme and Woo Commerce. On the shop product category pages, it doesn't display the category name and there are no <h1>'s ../nothing to make a <h1>. Does ...
0
votes
1answer
13 views

How to exclude a category returned by get_categories from function.php?

I have a plugin that create my website sitemap. It starts by getting all categories with get_categories and then gets all pages for each. However I have one category that must not be included then I ...
0
votes
0answers
6 views

Filtering get_terms so it displays tags by category

Is there a way to filter get_terms so it'll list only tags assigned to a post in a specific category? I have two categories on the site I'm building, Recipes and Nutrition and I would like to display ...
0
votes
0answers
9 views

Custom search bar - search in a specific category/tag field

I want improve on my website some search bars for search a specific post in only one category or tag. For example i have a page with 200 posts, eachone have one or more tags/catgeories: tag "x&...
0
votes
0answers
25 views

Change / Alter Product Category Link with Page Link

I'm using this snippet to alter a specific Category link with Page Link and its working well : function wpa_alter_cat_links( $termlink, $term, $taxonomy ) { if( 'category' == $taxonomy && ...
0
votes
1answer
20 views

Category Page Displaying all Pages

My page here: https://blackfreedom.proquest.com/category/civil-rights-and-black-power-movements/activism/selma-demonstrations-and-marches/ is displaying all pages on the site, not just the ones that ...
0
votes
0answers
9 views

Rewrite rule for changing permalinks. Post name to permalink with Category

SCENARIO A I have an wordpress site that has existing posts. Permalink structure is currently configured to https://sitename.com/%postname%/ I need to change the Permalink structure to https://...
0
votes
2answers
33 views

chose category in plugin

I am making a plugin to upload records and I want to put the option to choose category, also I would like those categories to be the ones that are normally created with wordpress, but I don't know if ...
1
vote
0answers
13 views

Category applied to pages, creates multiple breadcrumb entries after a search query (On the translated site)

I will try to explain the problem that occurred. Useful info: The site is up to date (plugins, WordPress, PHP). I use a premium theme and to do the translation I use the WPML. I have applied 2 ...
0
votes
1answer
11 views

Getting the same post on my related post

I am displaying the related products on my single.php page. I am getting two issues. When I am on a single page I am getting the same post on my related post. I have to show the max 4 post on my ...
0
votes
0answers
5 views

Product categories in url

I have following product categories in my app. Women -> Outerwear When I go to outwear category. Current URL is following foo.com/outerwear But I want to: foo.com/women/outwear how can I do it? ...
0
votes
0answers
10 views

Post shows up in database, not in dashboard, screws up other posts in the loop

I'm pretty new to WordPress development and I'm really not sure what's happening here. I've created a new category called "Advertorial" and my goal was to loop through it with a WP_query and ...
0
votes
1answer
9 views

Add Catgory (assign) to Post Programmatically (without editing)

I am looking for a way to assign (add) a category to a list of posts without editing each and every post - even by using bulk edit. Why? Because doing it manually (even using bulk) will update the ...
0
votes
0answers
11 views

how to make my custom gallery work in wordpress

So am creating a custom theme in WordPress and looking to achieve this I was able to output my category but not too sure how to output the remaining information. As you can see from the image below ...
0
votes
1answer
24 views

How to set acf color field as background color to product category

I have set an acf color picker field for woocommerce product category. I would like to set this color as a background to the category name that I've printed on the product page. I've tried to set the ...
0
votes
1answer
20 views

WP_safe_redirect not working

Instead of the project archives in my Divi theme being at /project_category/[category name]/ I want them to go to /portfolios/#[category name]. I modified the following code from this question and ...
0
votes
0answers
16 views

Create a post automatically associated to a category in wordpress

Hello guys I have many categories (Press release, News letter, Media Resources )when the client wants to create a Pressrelease post the one has to associate the post with that category, is there a way ...
0
votes
2answers
42 views

Get terms that are associated with products from current category

I need to list all custom terms (brands) that are associated with products from the category that is currently being viewed. E.g. I have these brands created: Shirt Brand A Shirt Brand B Shirt Brand ...
0
votes
0answers
18 views

Display related posts within the current posts category

This code has been referenced many times throughout WP forums and never seems to have an answer that works. The following code seemed to work and displayed a list of posts within the same category ...
0
votes
0answers
19 views

Is there a “sensible” limit to WordPress Categories?

I need to create 1,500 categories to a WordPress install. Some posts will have 150 of those categories. Is that crazy/ doable/ or "no problem" at all? PS I don't plan on showing (looping) ...
0
votes
1answer
14 views

I want to add the 10 most recent posts under a parent category on the main menu

I have two parent categories in my nav menu to act as separate blog pages. I would like to display the 10 most recent posts from each category underneath in the same menu. I have been searching and ...
-1
votes
1answer
21 views

Set default sort order to be by 'title' and posts per page to '100'

Need to change below code to have the default selection to be 'by title' and '100' per page function iknow_posts_sorter() { if ( $_GET && ! empty( $_GET ) ) { iknow_go_filter(); ...
0
votes
2answers
17 views

Show the amount of posts in a tag in a specific category has

I am creating a page template in Wordpress that displays multiple tags that are in a particular category. I have this working, but now I want to have the number of posts within each tag that is ...
0
votes
0answers
7 views

loop display list top parent categories except the current parent category

The website is look like this Cat 1 -- Sub cat 1 -- Sub Cat 2 Cat 2 -- Sub cat 1 -- Sub Cat 2 Cat 3 -- Sub cat 1 -- Sub Cat 2 I wish add a div to the parent and its child Category. In this div I ...
0
votes
1answer
32 views

Get parent category name when only child category is applied to a product

I'm trying to get the parent category of a product when actually it's assigned to a child category of the parent, but not the parent itself. The function below works when I assign both the child and ...
0
votes
1answer
52 views

WordPress list categories dropdown with parent-child relation and child under it's parent

I am attempting to display a category dropdown (select) with parent categories and child categories tagged under the child category. Example: parent A parent B parent C - child of C - child of C - ...
0
votes
1answer
17 views

How to prevent WordPress from redirecting single page to prefixed category archive with same name?

I have been trying to solve this problem for hours. I would like to have a page with a simple slug (/blog) and a category term with the same name (/category/blog) exist on my site together at the same ...
0
votes
0answers
16 views

Wordpress search and filter category filter

I am very new to coding so please bear with me... I have wordpress.org site and am using two plugins Category Tag pages - to add categories to tags to my pages Search and Filter plugin - to allow ...
0
votes
0answers
13 views

Help me to get product sub category name

I have a product with few first level categories and one subcategory. I need to get this subcategory (i know parent category ID) and view in some place with link. I've tried to get parent category, ...
2
votes
3answers
134 views

Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function

I'm using the wp_list_categories() function which generates an unordered list with list items and anchor tags for the categories. Is there any way to add HTML attributes to the <a> tags which ...
0
votes
0answers
13 views

Category Filter in Author Archive

In author archive, I want to show a list of categories; only those categories where that author has posts. (Optional: It would be great if it's possible to show the number of that author's posts ...
0
votes
0answers
11 views

Single.php - Back To Category Button

I've used this code to create a back button to my previous category and it works perfectly, but I want the button title in this case hard coded RETURN to be dynamic too TITLED the previous category. ...

1
2 3 4 5
91