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

I have a blog and want to prompt the user to select a category they like and have that select a random blog post

I'm building a website that shows the best dj sets. As a feature I want to be able to ask a visitor for an artist/genre they like, which are the same as my categories/tags. Either through a dropdown ...
0 votes
0 answers
29 views

Wordpress how to remove parent slug from category URLs

The structure I have now is: example.com/category/parent/child example.com/parent (I don't want this) This is how I want to build. How can I do that? Archive pages example.com/category/example-...
  • 1
0 votes
1 answer
14 views

Display different sidebar based on search results from one category

I have a website with a plant index page. It has a custom sidebar using A-Z Listings and a search form that only returns results from the 'plantindex' category. When using the sidebar search form, say ...
0 votes
0 answers
20 views

Adding category to existing post (uploaded file)

Brand new here and new to WP, running 6.1.1. I uploaded a file that appears in Media Library. What I want to do is programmatically assign multiple categories to the post after it is uploaded. I have ...
  • 1
0 votes
1 answer
16 views

Add Input Form for Select Category Like Tags

i have about 200 categories. When I have to publish a post, I select a category one by one. How do I select a category by entering such as adding Tags?
0 votes
0 answers
8 views

CPT Custom post type Tags & Categories not showing for 'Editor' user in editor

Using the CPT UI plugin I created the "Member Post" post type and associate the Categories and Tags with it. If I log into an admin account, the categories and tags show up in the post ...
0 votes
0 answers
78 views

Pagination only showed when no category is set in wp_query

tldr: On my production site only, when I set category_name to any category my pagination does not show up. Once I remove category_name from my wp_query the pagination shows up (for all posts on my ...
  • 135
0 votes
0 answers
5 views

How to limit number of posts in the certain category and exclude the oldest post automatically

I would like to have a php code which will exclude the oldest post from the certain category of certain taxonomy if total number of posts in this category (in the time of adding a new post) greater ...
0 votes
0 answers
12 views

How to remove category and other tags from posts page

On my website I have a primary menu. Under this menu, I have links for categories. When a user clicks these menu links, they're redirected to a landing page with all posts that are marked for that ...
0 votes
0 answers
19 views

I have a website issue I am trying to resolve

My website is jthomascrowne.com titled "The View From Here". I am currently using the Twenty Seventeen Theme on a Wordpress Business plan. I am relatively new to this. I know nothing about ...
0 votes
1 answer
55 views

how to create a page that shows all of multiple category posts on a single page

I have been attempting to get a solution to work that was previously posted for this question 1 I created the template as posted: <?php /* Template Name: Multiple Categories */ get_header(); $...
0 votes
0 answers
20 views

Quick Edit on taxonomy names results in error

If I press Quick Edit to the terms, inside a category or taxonomy I get a 0 as a result. You can look screenshot here: // Register custom taxonomy - Marker categories. function markerCategories() { ...
0 votes
0 answers
27 views

Can't create tags or categories

I can't create categories or tags from the category page nor creating them from a very new post. I get the message "unable to add the term to the data base" Things I've tried: Checking the ...
0 votes
1 answer
18 views

Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2

$args = array( 'post_type' => 'product', 'meta_key' => 'sorting_weight', 'orderby' => 'meta_value_num', 'posts_per_page' => -1, 'order' => 'DESC', 'tax_query' =&...
1 vote
1 answer
21 views

Get category of post inside save_post hook

I don't have much experience with hooks in WordPress so i have found a problem who don't look too difficult, but i can't find the answer. In my project i have a metabox who will get the content after ...
0 votes
2 answers
43 views

How to sort posts alphabetically based on a specific parent category

I'm building out an index page of posts that are grouped under multiple categories, but those categories are all under the same umbrella parent category. I'd like to have these posts displayed ...
  • 1
0 votes
0 answers
17 views

Invalid login email notification for password-protected category

Does vanilla WordPress (no related plugins installed) supports sending email notification or logging for invalid login on password-protected category? After reading the related documemt, I found only ...
1 vote
0 answers
13 views

Category Redirection Problem

I am trying to redirect all categories at once to a specific page but didn't find any solution. I go through a solution by redirecting one by one category to a specific page. So is there any solution ...
0 votes
0 answers
26 views

I need to get all categories from a WP_Query

Actualy i'm doing this $loop = new WP_Query($args); while ($loop->have_posts()) : $ID = $postData->ID; $freeCategories = get_terms(array( 'taxonomy' => "product_cat"...
0 votes
1 answer
34 views

filter on get_posts efficiently

I have posts with the following categories: A category that is a year(2017,2018...2022), a category that is type:(worldwide,Europe, local) I am trying to give users in the frontend advanced search ...
1 vote
0 answers
40 views

Categories not showing when all of the posts are private

I have a blog and all of the posts are private (only logged in users can view them). Still, when the users are logged in, Categories widget is still empty although there are number of posts assigned ...
3 votes
1 answer
48 views

How to add custom prefix before category base for category page URL?

Is it possible to add a custom prefix right before the category base of the category page URL(s)? For example, in the Category Page URL: sample.com/category/top-10, category base is category, and term ...
0 votes
0 answers
10 views

Custom Post Types Permalink

I have a CPT that I am trying to display the parent and child category in the address bar in the browser, but I am having a lot of difficulty figuring out where I am going wrong. I've added a rewrite ...
  • 1
0 votes
1 answer
26 views

Is there a function to modify existing previous/next post link without modifying theme files?

I was hoping to be able to just add a function just to keep the previous/next post links within the same immediate (not parent) category. Everything I've been able to find so far includes modifying ...
  • 13
1 vote
1 answer
51 views

Filters do not work when there are multiple (one works)

I have this functions code: function my_query($query) { if (is_post_type_archive('mycustomposttype')) { $orderby = sanitize_text_field(get_query_var('orderby')); $orderby2 = ...
  • 299
1 vote
0 answers
17 views

Get category name of current post (CPT UI)

I used CPT UI to create custom post types "Job Offers" which has a taxonomy with slug "job_offers_categories". In the CPT Categories I have 4 categories: Exchange Programme Job ...
0 votes
0 answers
17 views

Is it possible for post and custom post type to share a category base slug?

so I'm wondering if it is possible, could POST (base category) and CUSTOM POST TYPE (base category) share the same slug? Could you let me know what am I doing wrong? In fact I actually did it, both ...
0 votes
0 answers
36 views

Add custom fields to Woocommerce Category Page

I want to add custom fields to Category Woocommerce items (page-products-cat); I have tried using this code but It does not work : add_action(‘product_cat_edit_form_fields’, ‘...
0 votes
0 answers
9 views

How to get recent one post from each category on home page?

I am trying to display one post from each category. I currently have five categories, with two parents and three children. Animal, -Cat, and Home —Water Filter -Kitchen. Code have error if any recent ...
  • 9
0 votes
0 answers
11 views

How to hide my categories pages' names, and how as well to reduce the space beween my sidebar's widgets?

I'm currently building my own website using Wordpress as well as the Astra theme (free version). I've been encountering two main issues to which I still haven't found any solution yet : first of all, ...
0 votes
1 answer
34 views

category_count gives wrong number of posts in category

I have a bilangual page where posts are sorted by categories and subcategories. When i check hoew many posts are actually displayed on a category page I get 312 in both languages. When I check the ...
0 votes
0 answers
12 views

How to get specific number of category post on a page or category page?

<div class="ftcat-filtered"> <h2 class="filtered-title"> All Product Reviews</h2> <div class="cat-paged"> <div ...
  • 9
0 votes
1 answer
29 views

How to get all Existing Categories from a Custom Post Type

so I'm fairly new to worpdress development and I'm still learning my way through, I tried searching anywhere but I cannot find the answer I'm looking for. The image below is the All categories from my ...
0 votes
0 answers
12 views

Sort Category Archive pages and place sticky posts first

I have a very simple request: I want to sort my posts within the category (or tag) archive page by date (which is the default), but put all sticky posts first. I found working code snippets for ...
  • 1
0 votes
1 answer
14 views

Show last child Child category instead of first child category on page

Our website: www.cinemanext.at basically shows the first child category of the category events (click page "events"). Now, page "service" shows category service, which is a child ...
0 votes
0 answers
16 views

How can I fixe the article title problem?

Theme used:Zakra Site address : https://numadigit.com Hi, I have noticed for a few weeks that my sites under WordPress are misinterpreted for the SEO tag by Google. Indeed, in the title tags of the ...
0 votes
0 answers
45 views

Use same wordpress category base and tags as the prefix as the post permalink

I want to use wordpress permalink structure as /blog/category/post-name And I also want the archive pages to be like /blog/category In order to keep permalink structure When I apply on the structure /...
0 votes
1 answer
26 views

sub-category showing up in wrong order in breadcrumbs

On my site nwtraveler.com when I create a new post with the primary category of "Oregon" and sub-category as "Southern" it lists them in wrong order in breadcrumbs... All the other ...
0 votes
0 answers
14 views

Automatically select category based on user role

I have a website where I want all our 'Author' user types to submit their posts to one specific category, however the website has a total of 4 categories. Is there a way to automatically 'check' a ...
0 votes
0 answers
46 views

Display all categories (with link) of custom post type - Wordpress

I have custom post type "case study". Inside it i have few categories. I want to display all existing categories from this "case study" CPT. I successfully listed items from CPT on ...
0 votes
0 answers
12 views

Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)

Here is my code, currently when viewing a post it ends displaying posts from second child category(second in hyracichal while we have 4 stages). I want it to display posts from 4th child category, if ...
0 votes
0 answers
13 views

Categories and products woocommerce wordpress

I am trying to exclude all products that does not belong to the respectively category. For instance, I have a category called: Animals. A subcategory called Lions and Tigers which is childs of Animals....
  • 121
0 votes
1 answer
33 views

Show some texts in posts belonging to Specific category

I am trying to add some text to the end of every post belonging to a specific category. I am using the following code - <div class="repair-tool"> <?php $catarray = ...
  • 17
0 votes
1 answer
13 views

Removing all Category pages with one exception

I am using this code to remove all category pages, however I wish to retain a certain category with ID number 20. How may I do this please? // Remove category archives add_action('template_redirect', '...
  • 608
0 votes
0 answers
22 views

Export Posts Without Categories In An XML File

I have an xml file with posts, authors, images, and other content that I am importing successfully into a new site, but I would like to remove all categories from posts and make them uncategorized at ...
1 vote
0 answers
25 views

Add Category names to post lists of custom post type

im beginner at codes, I have some code to show posts of "Custom Post Type" and it's working and it shows post titles, I want to add a category name to it too. " I tried <?php echo ...
0 votes
1 answer
17 views

How can I show second most recent post in sidebar, if most recent post is open in the browser?

I am working on an online magazine in WordPress PHP. I created a custom post type (article) with 4 available custom categories. In the sidebar I want to show the most recent post of all the 4 ...
0 votes
0 answers
22 views

List the category tree of all the product_cat categories

I am trying to list category trees of all categories in product_cat I can more or less do this with get_categories and get_ancestors. However, I have no clear idea how to use them. I want to make ...
0 votes
1 answer
28 views

Create Wordpress category dynamically

I have more than 15 Category , And i have a custom taxonomy "classroom", Is there any way to Create those categories automatically when i activate plugin?
0 votes
0 answers
10 views

How to create a photo gallery that can be filtered by the image categories

I am trying to build a page that contains a photo gallery with the categories of all photos displayed above it. I'd like to be able to click on one or more of those categories to filter the images. I'...
  • 113

1
2 3 4 5
96