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

Show Subcategories in Specific Menu item Using Walker Class

I want to show subcategories in specific menu item with custom div structure using walker class, My scenario is when I add a category in the menu from backend so show subcategories in that specific ...
0
votes
3answers
18 views

Category tags with comma's

I have in my code the following variable to call the title of the categories. <?php $categories = get_the_terms($custom_args->ID, 'veranstaltungen-category'); foreach ($categories ...
0
votes
0answers
4 views

Show and group products by category on checkout page and order confirmations

I am trying to have my CART and CHECKOUT pages display the category that a product belongs to, and also group the products by that category no matter what order they were added to the cart in. I'd ...
0
votes
1answer
12 views

why get_the_post_thumbnail( the_ID()) echos extra post id

I have the following snippet which adds post thumbnails to products on archive page if matches a given product category, which will output the image but echos the the post id as well. How do I ...
-1
votes
0answers
11 views

How can I nofollow the links to post from categories and tags?

For SEO reasons, I want to nofollow the links to post from categories and tags pages. How can I do it?
0
votes
0answers
26 views

Category of search results

Would it be possible customise the search results to add the category after each search result? Something like: Search result 1 Category A Search result 2 Category B Search result 3 Category A ...
0
votes
1answer
26 views

Convert With Custom Post Type

Instead of using a regular post with category (Properties), I created a Custom Post Type (Property). So, I'd like to convert the following code so that it's using the custom post type instead of ...
0
votes
1answer
20 views

How to show a list of only categories (exclude subcategories)

I have a list where you show me the categories, but I would like you not to show me the subcategories, only the categories $term_id = get_categories(); if (function_exists('get_wp_term_image')) {...
1
vote
1answer
19 views

How do I get a list of all categories that a given user has written blog posts for?

I need to retrieve the name of all the categories that a given user has published posts for. If I can also get a URL for the archive of that cat for that user only, this would make me very happy. How ...
1
vote
1answer
28 views

get current product name in functions.php

i create a button in a current product page after woocommerce_single_product_summary i would to get information about the current product ( for example name and price) and through the button send an ...
0
votes
1answer
20 views

Correct Hook/Filter to amend category choices on post edit page

I want to filter available terms for a user when they create/edit a post, I have assigned a custom field to the user where it returns an array of IDs for the categories they can edit. In an action ...
1
vote
1answer
64 views

Can paginate_links() be customized for a specific category or tag?

I am creating category and tag page templates for my client so they can post news articles to the news category page and specific news pages separated by tag with a pagination nav at the bottom of ...
0
votes
1answer
22 views

Get all the blog's categories and the related URLs?

I'm confused as to how to fetch the list of all the blog's categories (sans empty ones). I need the textual name and the URL to the cat archive as an array. Do I use get_terms(), get_categories(), ...
1
vote
3answers
36 views

List of the years with posts presented

I need to get a list of the years with posts of given category. Like this: 2008, 2009, 2010, 2012, 2013 (if there were no posts in 2011, it's not included). I try this query, and it works — I get my ...
0
votes
2answers
15 views

Display a mixed list of posts and media

I have a list of articles on my website. Some of the articles are post types with the "Article" category and others are PDF files uploaded to the media library, also with the "Article" category. I ...
1
vote
0answers
20 views

Different display types for different posts on category page [duplicate]

I was wondering what would be the best way to 'set' different display styles for different posts in the loop on a category page? That's what I would like to end up with: <div class="container">...
1
vote
1answer
10 views

batch adding posts to a category based on matching regex for title with SQL

I am adding location categories to posts based on keywords in title (with regex), I got it working once, so code is fine the first time, but now get SQL Error (1062) Duplicate entry '4419-268' so I ...
0
votes
1answer
27 views

How to list categories in reverse alphabetical order?

I am organising posts on a blog-type website into "issues", each containing 10 articles and assigned a unique category such as issue7. Using a sidebar widget I want to list these categories so that a ...
0
votes
0answers
17 views

Paginated Category with Custom First Page

I'm creating a blog, and I have category pages set up to show a custom layout on the first page. However, my pagination is broken and I can't seem to figure out the issue. Below is my code. It counts ...
0
votes
1answer
17 views

Why get_category() function is not working not working when embedded in a page?

I'm using PHP everywhere plugin to insert PHP snippets in my page. Specifically, I'm trying to get posts count in a category. Here's my code: <?php $count=get_category(607)->count; echo $...
0
votes
0answers
8 views

Password protection for pages and categories stopped working for me [on hold]

So my wordpress page uses access category password to limit visibility of a category of posts that should only be seen by board members (who have the password). This worked until I made a host switch. ...
0
votes
0answers
22 views

how to give different template to each subcategory from same parent category?

Sports live score standings Transfer As seen above...the parent category is Sports with three subcategories (live score, standings and transfer)...Can each of these subcategories have ...
0
votes
1answer
21 views

How to create a page that shows posts from multiple categories

looking to create a page that will show all posts from several categories. for example lets say I want all of my posts from category 1, 5, and 9 together. the posts on the page should be ones from any ...
0
votes
0answers
27 views

How to allow each editors to only edit certain categories?

I have 6 users with an editor role, each editor should have access to 1 category (different for every 6 users). Besides this, I have another 20 users which are moderated by 1 editor, so 1 editor x 20 ...
0
votes
0answers
20 views

How to create a table with counts of category combinations?

I have two main 'groups' of categories. I would like to have a table on a certain page that contains counts for the number of posts with combinations of categories from these two groups. So for ...
0
votes
1answer
10 views

selecting categories that have products with tag/category

i have a lot of product categories on the website - 100+ some products are tagged as "is_new" via custom field. When that happens that are also automatically assigned to a product category "New". ...
0
votes
2answers
25 views

I want to show category name when using [category] shortcode

I want to show the category name of the post when I write [category] shortcode in the post body. I'm using this code but only showing array error. Sorry, I'm not an expert in coding. Perhaps you can ...
0
votes
1answer
35 views

Redirect Changed Permalink on wordpress

Please I recently changed my site permalink structure, from https://example.com/postname/ to https://example.com/category/postname/ I have searched online and even here but all I am seeing is /...
-2
votes
0answers
31 views

Show taxonomy list with taxonomy ACF images [duplicate]

i have a taxonomy list in the home page made with https://wordpress.org/plugins/wp-categories-widget/ plugin .. i crated image field for taxonomies with ACF. i can show tax image on archive page but i ...
0
votes
0answers
13 views

I changed the template for WooCommerce product for category image (Category and Taxonomy Image plugin) but the image is still not displayed. Help!

I am trying to display category image instead of text on my product archive, but looks like something does not work. I am using Category and Taxonomy Image plugin (https://sl.wordpress.org/plugins/wp-...
0
votes
1answer
19 views

Exclude parent categories from recent posts list

I want to show only the sub-categories from a post's specific parent category and exclude all the other categories. This is for a loop of recent posts on my front-page.php. Each recent post is ...
0
votes
1answer
15 views

Bulk assign posts to a category using SQL (MySQL)

I am migrating a wordpress site from QTranslate-X to WPML (2 multi-lingual plugins). In the migration, all my posts that belonged to a given category (healthy in English, sain in French) were ...
0
votes
0answers
17 views

How to display category image instead of text on product archive and single

How can I display category as an image rather than text? For example, if category is "Adidas", I would like to display logo of said brand. The category images would be displayed on product archives ...
0
votes
0answers
33 views

show custom post count of a custom taxonomy and exclude posts that also attached to another custom taxonmy

i have a custom taxonomy list with post count and it is sorted by post count. But some of these posts also is attached to another custom taxonomy list and i want to exclude these post from taxonomy ...
0
votes
0answers
16 views

sort post category listing

By default, when a post with multiple category (or category with sub category) is created, wordpress listed those categories in alphabetical order in the admin post listing page. Is there any way to ...
0
votes
0answers
14 views

Show Gutenberg Categories Block on custrom plugin

Is there any way to import/use the gutenberg categories block in a custom gutenberg panel? I want to avoid to write it again by myself
0
votes
1answer
19 views

How to 301 redirect from url with post id to permalink with post name (slug)?

my posts have urls of two different types: one with post id and other with post slug: /post/789 /post/my-post-slug i'm doing this using: add_rewrite_rule( 'post/(\d+)/?', 'index.php?p=$...
0
votes
1answer
11 views

Category list with postcount

Im total noob with wordpress, and would like to get some help with following problem. I Would like to make list of all categories and postcounts in category, something like this: category1(2), ...
0
votes
1answer
41 views

Create/Set Category as Title of Post

I am fairly new to PHP. I wanted a code snippet to create post category from the post title. If the post title does exists as a category, then assign the post to that category. If the category doesn't ...
0
votes
0answers
21 views

Categories not showing up, but it says there are 14

For some reason the categories on my site seem to have disappeared. "No categories found". But it also says there are 14 items in categories (see screen shot). I can't add them back in, at least not ...
0
votes
1answer
101 views

Repeater field empty taxonomy and saved choices

I'm in trouble right now and I need you to help on a little problem that I have. For one of my clients I need to use ACF repeater field and populate it with empty categories from a custom taxonomy ...
0
votes
0answers
27 views

How to change site-title-url for specific category or page in php?

In wordpress website, we have different categories like Collaboration, Healthcare, Economy etc. I have made separate blogs pages for each category. Required change is if user is on Healthcare blogs ...
0
votes
1answer
44 views

Hide products in uncategorized category from search results

I have about 20000 products and I am using electro theme. All of them belong to uncategorized category (id: 979) and most of them belong to other categories also. I want to hide from the search result ...
0
votes
0answers
11 views

how to show all of post's “categories” that include a specfic tag for those posts

How to show all of post's "categories" that include a specific tag for those posts under those categories Thanks Mario
-1
votes
1answer
24 views

Show thumbnails 1-12 of category x on any given page

Using wordpress twenty nineteen, I checked the forum but cant find this same question. I would like to display the 12 most recent posts from category x, using just a thumbnail of the featured image ...
0
votes
2answers
33 views

Excluding specific category from custom theme functions

I've currently got some custom theme functions running (custom single product page and java script) although want to exclude a specific category from them. How do I go about this? I currently have ...
0
votes
0answers
19 views

Woocommerce - Order categories and then pull products by that order

I will give an example what I am trying to make. I have 1 parent and 2 child categories - Sport > Football & Basketball. Also there are 2 custom taxonomy terms (Brands) - Nike & Adidas. Now, ...
1
vote
1answer
22 views

How to exclude children categories of parent category

I want to list only certain categories and exclude a particular parent and all its children. The reason is so that if a new child category is added, it won't show up by default. With ...
0
votes
1answer
24 views

How to distinguish pages created by woocommerce?

I am working on a theme and I have come to a situation when I need to distinguish the pages that are created by the Woocommerce plugin (e.g Shop, Cart, etc.). So far I've installed this plugin which ...
0
votes
0answers
15 views

How to create list of categories and get post page

I have a list of categories page, and i want if i clicked on the category it will take me to list of post that using the category. I know this confusing, but i give example sitemap Parent Category 1 ...