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

Meta Query | Compare category name and meta value

I like to create meta query that has a condition like this. Using comparison of meta value, and omitting articles which belongs to category that is same name of meta value. Each article belongs to ...
0
votes
0answers
9 views

Php string not working in Wordpress Functions.php (trying to fetch 1st category for each blog that post appears in the sidebar)

I am trying to fetch 1st category for each blog post that appears in the sidebar of any blogpost landing page. I tried multiple options to add the 2nd block code to the 1st block at the line "....
-1
votes
0answers
16 views

How do I turn CPT automatically also into category?

When I create a new post on a CPT I want to automatically turn it also into a category to appear in another CPT. Example: I have a post type called "School Subject" and when I create the ...
0
votes
0answers
7 views

How to filter tags by category?

is there a way to add a custom filter in the Tags admin page? I'd like to filter tags by category. I saw plenty of custom filter for the POSTS admin page, like this one that filter posts by format: ...
0
votes
0answers
16 views

Control over custom post types on a specific page

I'm looking for an option to show a specific Custom post type on a specific page. In a category there are 10 posts but on the homepage I just want to show for example 3 specific post types of that ...
0
votes
1answer
6 views

Get Categories of multiple posts

So I have bunch of custom posts & IDs (coming from ACF Fields). and I want to get all categories of those posts. is there any way we can get all unique categories from array of post IDs?
0
votes
0answers
11 views

Checking For a Specific Parent Category from Subcategory Page

I want to write some code that checks to see the current category, and then checks to see if it falls under 3 potential parent categories. So if I had a setup like this: Market --food ---chocolate --...
0
votes
0answers
8 views

How can I display a category page with future sub categories?

In a recent project I had to build a custom category page. On this parent category, I display sub categories.(just thumbnail and title) Some of these subcategories'posts will be published in future. ...
1
vote
1answer
12 views

How to show CPTs in term archive

I attached default taxonomy "category" to a "story" custom post type, when I register it: 'show_in_rest' => true, 'show_in_feed' => true, 'taxonomies' => ['...
-1
votes
0answers
18 views

I am trying to replace DROPDOWN SEARCH FIELD with KEYWORD SEARCH FIELD. My dropdown Search by City is not effective due to huge amount of cities [closed]

I need to replace dropdown search field "Search by City" with keyword search field "Type City". Dropdown search is not effective due to over 30 cities. Keyword search will be much ...
0
votes
0answers
13 views

Tags, categories or attributes for thematic item?

for a new website I need to use categories as geographic categories and I need to have something to indicate the pre-established thematic, just think about a news site with geographics categories full ...
0
votes
0answers
7 views

Count for Media Library Attachments specified by Categories

I've added this function into my function.php file that allows me to specify images in my media library with categories. /* Add Categories for Media Library Attachments /*------------------------------...
0
votes
0answers
7 views

Nested URL with categories, sub categories and pages in between

I'm a bit new to wordpress and would like to know how to achieve the following structure. Essentially I'm creating a website for a store that carries multiple products. For example: site.com/brand/<...
0
votes
0answers
19 views

How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?

The Setup I have divided my blog into 3 categories with their respective slugs. There are 3 pages corresponding to these 3 categories with their respective custom page templates. On each page, I ...
0
votes
0answers
14 views

How can I list the recent posts of a specif category and its descendants?

Category 1 Category 1.1 Category 1.2 Category 1.3 Category 2 Category 2.1 Category 2.2 Category 2.3 When user access SINGLE or ARCHIVE pages of category 1 or any of its descendants, he should see ...
0
votes
0answers
10 views

How to fill custom field with category ID

I am looking for a way to automatically fill a custom field with category ID (or with name). Value of custom field should update whenever I change the category of post (or when I save post). Thanks ...
1
vote
1answer
21 views

Custom HTML in specific category single page and its descendant categories

I am trying to insert a "style" in single page of a category and its child categories. .relatednews{display:none}. I inserted the following code in functions.php of Child Theme, but it didn'...
0
votes
0answers
25 views

How to localize category names in admin

I have a category with an English name like "News" and a German translation of "News" in the de_DE .MO file. When a German user is editing a post, I'd like them to see the German ...
0
votes
0answers
18 views

What is the best approach to rebuild product category tree completely?

I have a pretty large hierarchical list of product categories (almost 300) which I need to rebuild from scratch. Once the category tree is completed, I need to re-assign all existing products (more ...
0
votes
0answers
35 views

Display a category custom field on a single page [closed]

Display a category custom field on a single page Hello, I made a custom field with ACF to add a text field (name 'artistemail') for each categories. Now I want to display this field on a single page (...
0
votes
0answers
15 views

How to display all posts in a category at the end of a single post?

The "work" page for my portfolio is simply all the posts in the "work" category. They are displayed as a thumbnail grid. Here. <?php get_header(); ?> <div class="...
1
vote
1answer
31 views

wordpress sub-category ( lowercase letters + non-latin characters ) = 404

If the sub-category's slug is a combination of lowercase letters and Korean, page 404 appears. 1 : NGINX settings location / { try_files $uri $uri/ /index.php?$args; } 2 : Wordpress - Permerlink ...
0
votes
1answer
17 views

How to add commentary types or category for a post

I need to create three types of comments por a post. The idea is to not mix up all the comments and let the users comments for a particular subject of the post. So define comments type A, type B and ...
0
votes
0answers
24 views

Yoast breadcrumb URL shows category instead of the page

I have setup Yoast breadcrumbs in my category pages en posts inside that category page. Category page: home/diensten/ Post page: home/diensten/support/ When I want to navigate back from the support ...
0
votes
0answers
28 views

Display post according to parent categories and child categories

I got a task of developing an Informative site and I have some issues in displaying information about products according to categories. I have added the product details as post and need to display ...
0
votes
1answer
23 views

Custom post type data not displaying If I select the category from the dropdonw

I have created a custom post type. I am able to add all the details and it's working. I have a dropdown and I am getting my category in that dropdown. Once the user selects the category from the ...
0
votes
2answers
32 views

Inline If statement to echo CSS [closed]

I have a line of code in my template I would like to add the css class "has-video" to if the post is within a certain category. I am trying to do this inline with ' . ( if (in_category(42)) ...
0
votes
1answer
15 views

What is an equivalent of single_cat_title for getting the slug of the category?

I searched for something like single_cat_slug but I did not find something relevant. All I don't know how to do it is to find the slug, not the name, of the currently opened category page. I do not ...
0
votes
0answers
26 views

Custom Post Type with Sequence ID

I am looking for a way in WordPress custom post type (portfolio) to manage the content of each category with a specific ID sequence. With the "Custom Post Type Permalinks" plugin, I can ...
0
votes
1answer
30 views

How to create a custom meta box field in category? [duplicate]

I'm creating a website, and I want to associate images every time I create a new category? Does anyone know how I give this option to the user through this menu?
0
votes
1answer
15 views

Automatically add custom taxonomy to posts in a category

I'm working on a podcast website where the theme requires all podcast episode posts to be in a custom taxonomy called qtserie. The name of the particular qtserie taxonomy that these episodes should be ...
1
vote
0answers
8 views

select parent category first then child

Hello I'm trying to select parent category first then the child My code on template look like this <?php if( isset($_POST['prop_category']) ) { $prop_category_selected = intval($_POST['...
0
votes
1answer
19 views

Get Posts by Category, Tag , and CPT Taxonomy

How to print only those posts which have Category, Tag, CPT Taxonomy. I have tried out with this code but nothing prints. To print posts I used SS [commonposts category="2" tag="3" ...
0
votes
0answers
15 views

How to add custom code or a action to the woocommerce subcategory count html hook

I am trying to add a button below my category title of my woocommerce site. This is the function that delivers the category title. How can i add a hook to this section that i can use to get my button ...
1
vote
0answers
29 views

The Category page shows all the posts, without differentiating by categories

I'm using a custom template, and when a category is selected in a blog post, it takes you to the Category page where the articles related to that category are displayed, however all posts are ...
1
vote
0answers
14 views

how to get the categories for a single product in a hierarchical way

It's the first time I write here, but I really appreciate your work from long time. Well, I know there is a very similar question, but I can't get out the solution for my particular case. In a ...
0
votes
1answer
9 views

Show single post child category from a determined parent

I am trying to show in a single post child category from a selected category. For some single post, I have a category that is corresponding to an area. I want to show that category in a special area ...
0
votes
0answers
19 views

Wordpress URL auto correct returns pages from a different category. Can this be changed?

I have categories set to be part of the url and there are pages that start with the same slug but in different categories. /category-A/123-hello-world /category-B/123-some-longer-slug-here If a url is ...
0
votes
2answers
38 views

Author post count in category

I want to count authors post count in a specific category. How do i do that? I have red this thread here but still can't fiure it out. Count number of posts by author in a category Edit: This is what ...
0
votes
0answers
13 views

How do I change my site logo for categories?

I'm attempting to make my Categories appear as though they are separate pages, and would thus like to have a different custom logo in place of the logo that's currently on the home page. I see this in ...
0
votes
0answers
17 views

How to Show All Categories Related to a Tag

Is there a way to show all categories in a tag page (all categories from posts by a tag)?
1
vote
1answer
27 views

Exclude category from

I am trying to exclude a category from <?php the_category(', ') ?> inside my loop. I came across the following code on CSS tricks that says would solve the problem. You add this to the functions:...
0
votes
1answer
17 views

Show audio player only in specific post type category

I have a code that autoplays audio and it is working well but the stuff is I want the autoplay to only run in a specified woocommerce category. Any help will be appreciated. The code is below. ...
1
vote
1answer
28 views

How to limit posts by category

I was wondering if there is a way to make this code limit by category. In other words, if user A has already published 10 posts in category A then he can keep the new ones as drafts in category A or ...
1
vote
0answers
14 views

Automatically check parents (in a taxonomy) when child is selected

On my website I have a custom taxonomy which contains a lot of parents, children, subchildren etc. Because of this, it is really long to manually find what I want, so do you know if there is a way to ...
0
votes
0answers
17 views

Child-Theme Category View with modified permalinks (%category% removed)

I created a new WP Website and added a child-theme to it. The child-theme contains header.php, footer.php and I also created a category.php, in which I show different headers for each category. I ...
1
vote
1answer
14 views

Not able to open category post [closed]

my website home page working perfectly fine all links are clickable and opening, but when I open any menu or category page I’m not able to click and open the post. However, If I right-click and open ...
0
votes
1answer
24 views

how to wordpress When I click on the category link, subcategories appear

What can I do to make subcategories appear when I click on the category link $categories = get_categories(); print_r($categories); foreach($categories as $category){ if(!$category-&...
0
votes
1answer
19 views

Post category behave like a Post in back office menu

I'm wondering if there is a trick to make a custom post category behave like a custom post so I can have multiples menu entries for each categories ? Here we have two menu entries for two post types, ...
0
votes
0answers
13 views

Is there is any way to add validation for sub categories in backend while publishing posts

My requirement is while submitting posts, If I selected a parent category that has a child category, I need to add validation, I need to select only child category if it has a parent category. For ...

1
2 3 4 5
93