We’re rewarding the question askers & reputations are being recalculated! Read more.

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

Notice: Undefined variable

My website notices that $separator at (#1) and $authorpost at (#2) are undefined variables. Although it still works. How to fix this? I have no training in how to code, hope someone can help. Thanks ...
0
votes
1answer
9 views

Can't delete a category in Wordpress

I can't delete the Gallon Tanks category from my site, and I have no idea why. My site isn't using the Gallon Tanks category at all in the navmenu.
1
vote
1answer
37 views

Error: array_map(): Argument #2

Once I've updated WordPress to version 5.3 with this error message: [17-Nov-2019 01:15:14 UTC] PHP Warning: array_map(): Argument #2 should be an array in /home/name/public_html/web/wp-includes/...
1
vote
1answer
21 views

retrieve thumbnail from post ID of best selling product in category

The code below displays product category names, links and their thumbnails on hover. The thumbnails ($image) retrieved are those manually set via the woocommerce product category menu. I am trying ...
0
votes
1answer
15 views

hover image appears below placeholder instead of overlayed

I used padding-bottom calc to stop my text jumping around while the placeholder loaded. This worked, however the hover image which is supposed to display over the top of the placeholder, now appears ...
0
votes
0answers
13 views

Category with Multiple Names

Is it possible to have multiple category names that all filter into a single category? For example, if I have Category-A, but sometimes it's called by another name, can I have a Category-B that ...
1
vote
1answer
17 views

Sorting category products not working

I am using Avada theme and the sorting of the products on category page is not working. When i click on ascending and descending order the ordering of the products becomes random. Please provide me ...
0
votes
0answers
14 views

How to “remove” WordPress categories UL and make the list loop in a horizontal line?

When you list categories in WordPress they are looped via an array using a standard manner like this: <ul> <li>catgory1</li> </ul> In ...
0
votes
1answer
16 views

Only show size attributes in product box woocommerce when available

First of all I want to say I have little coding experience. I want to show available sizes in the productbox on the shop page. I got this working after some searching around here. Now I want to only ...
0
votes
0answers
14 views

how can I edit the HTML of yith ajax product filter

this question is basically the same as How to edit plugin's html? but they also did not get an answer to their question. I am using Yith AJAX Product Filter Premium Plugin and I am in contact with ...
0
votes
1answer
45 views

How to add a background image to category and display image on category page

I have categories on my website. I have to add a background image to each category while creating the category without using any plugin. I tried some code in function.php and I refer this link. but ...
0
votes
0answers
12 views

Display post taxonomy based off custom metabox selection

I am using CMB2 to display a custom taxonomy which is calling the categories from my post and displaying the results within the page backend in a select field. Each page will have the ability to ...
0
votes
1answer
37 views

How to create a custom categories page

I am working on a WordPress website. My issue is, I have single.php code and this code is displaying a single product view. But when I click on any categories then the same code is working for ...
1
vote
1answer
88 views

combine Code 1 with Code 2

Code 1 - uses wp_list_categories to list product categories in columns of x categories up to a total of y, with a link to view all categories if there are more than y. Code 2 - Later realising i ...
0
votes
1answer
15 views

has_category() for parent category

Is there a way to make a condition for posts belonging to any sub-categories of a given parent category? Here is an example, assuming the following category structure: News FAQ 1) Installing 2) ...
0
votes
1answer
63 views

get taxonomy thumbnail and use it as a variable in code

Im having trouble trying to retrieve category thumbnails and use as a variable in some code i got from a JSFiddle. It puts a placeholder image as default and displays a category image on hover of ...
0
votes
1answer
33 views

Post List by category and under custom taxonomy

I am trying to listing posts from a single category with custom taxonomy and several sub custom taxonomies. sub custom taxonomy "Knowledgebase" post KB 1 post KB 2 sub custom taxonomy "Optimization ...
1
vote
2answers
27 views

WordPress category widget only show categories with children

I'm trying to modify the inbuilt WordPress category widget to only show categories if they have children. I was using this code: function exclude_widget_subcategories($args){ $all_categories = ...
0
votes
0answers
15 views

Category post thumbnails are not displaying (Some post thumnails are displaying icon as thumbnail)

I am working on a website where i tried all default settings in wordpress dashboard to display thumbnails for category posts, but it is displaying icon as post thumbnail, i have not customized any ...
0
votes
1answer
17 views

Make categories appear random

I have 5 big categories and there are many small categories in them. If I click on the category menu, I can see the posts in order of date. But I want it to be displayed randomly. How can I make a ...
1
vote
0answers
22 views

Show category from “Next post” and “Previous post” [edited]

Posts are marked in a level 3 category. For example: City (which has the upper categories: State and Country). - Country -- State --- City I would like the level 2 (State) category to be shown along ...
-1
votes
0answers
11 views

How do you query custom post types with the same category name as the post title?

How do you query custom post types belonging to a category with the same name as the default post title of the post where the post types are displayed?
0
votes
1answer
14 views

in post content shortcode works, but hardcoded in same page template doesn't?

So I have a super simple Woocommerce shortcode [product_categories], It's supposed to show product categories from the shop. It does this job perfectly if I put it inside the contents of a page as ...
0
votes
0answers
8 views

Url for random post (in specific category)

I know that a URL formed: samplewebsite.com/?random will redirect to a random post. Is it possible to create a URL that will redirect to a random post within a particular category? samplewebsite....
0
votes
1answer
22 views

Automatically create tags and merge with categories

In the following code I can set tags automatically and add to a pre-existing category: <?php function update_post_terms( $post_id ) { if ( $parent = wp_is_post_revision( $post_id ) ) $...
0
votes
0answers
28 views

how to filter posts by category without page load (ajax) in wordpress?

I Tried this code, here: http://rankonone.com/dev/profdharm/monthly-rashifal/ August, October, September are categories, I want to show post below without page load where currently title and date. ...
0
votes
0answers
14 views

Multiple teams on different pages of same website

Just wondering whether it is possible to have different teams on two web pages on the same site. At the moment it seems all the team categories show on the same web page and I can't turn any of them ...
1
vote
2answers
27 views

How to hide category name

I have a category about the catalog, news1 Which I use to get a post on the main page. The problem is that I don't want the news1 category name to appear in these posts, but I want other categories to ...
0
votes
1answer
27 views

front end add category to new post

This is my issue, i hope to find the answer here. <div class="form-group"> <label for="genres" class="col-sm-2 control-label">genres</label> <div class="col-sm-10"> ...
0
votes
1answer
13 views

How do we display a certain category type on a page while hiding all others?

We need to hide a specific category type on all pages but one, and then display that hidden category on a singular page. So far, to hide the category on all pages, we have coded this: // Exclude ...
0
votes
0answers
21 views

I want to get latest one post of a particular category

I want to get the latest one post on counting View Count. Latest I have tried this but didn't get the result : $popularpost = new WP_Query( array( 'post_type' => 'post', 'posts_per_page'...
0
votes
1answer
14 views

Link To Child Category For A Post

I'm trying to display a link to just the child category on a Wordpress post. For instance if the category for a post is parent > child I want to show a link to just the child category page. I'm using ...
0
votes
0answers
17 views

Display Specific Parent and Child Category Lists with Format

I have a code that I want to display in lists. <nav> <ul class="simplefilter filter-port"> <li class="btn active button btn-hover" data-filter="all">All</li> ...
0
votes
0answers
10 views

Filtering custom taxonomy category on admin side

Is there any hook, or maybe there is already a plugin for that. The problem: There are lots of categories and it is difficult to find through so many pages. I need: A dropdown selection filter which ...
0
votes
0answers
5 views

How to display 5 images of each subcategories of one category named “galleries” not dependent on a post or category page

I'd like to create a preview gallery page where each gallery display 5 images and the title with a link. These galleries are in subcategories (cars, events, flowers) of the category "galleries" or id =...
0
votes
1answer
21 views

Unable to create pagination for Category.php

I'm trying to make a pagination for my category.php. My posts are custom post type. I get a 404 not found error when I'm trying to get to the second page. I realised that this is happening only for ...
0
votes
0answers
9 views

Breadcrumb NavXT link to page instead of category

I am using the breadcrumb-navxt , but i wanna change the links from category to a page i used this code, but it didn't work add_filter('bcn_breadcrumb_url', 'my_breadcrumb_url_changer', 3, 10); ...
0
votes
0answers
21 views

Show related products only for primary category

I have found this snippet for showing related products from the primary category. // Alter related products query to pull items from Yoast Primary Category add_filter( '...
0
votes
2answers
32 views

Is there a reason to put a product in both the Child and Parent Categories?

I have a few product Parent Categories with Child Categories. Is there a difference if I place the products in both the Child and Parent Categories, or if I just place it in the Child Category? In ...
0
votes
0answers
10 views

Make category required

I want to prevent a post from submitting if no category is chosen. I don't want them to be automatically in the default category but really force the user to choose a category. I found this question ...
0
votes
0answers
36 views

Post is uncatagorized in publish_post action

I've added several bits of metadata to my post categories. When that post is published I want to copy some of those meta values into the custom fields of that post. add_action('publish_post','...
0
votes
1answer
39 views

Custom Post Type Category URL

I've created a simple CPT named shop which contains some shop items. After that I've added category support to it which works fine ('taxonomies' => array( 'category' )). Then I created template-...
0
votes
2answers
41 views

Want a custom query with just one category but from all custom post types

I have a template created where I want to call up all post types, but display only those from a common category. The results I'm getting are all normal blog posts and some from one of the custom post ...
0
votes
1answer
22 views

How do I list custom taxonomy terms with the links?

I've the following code which gives the list of the portfolio category as text. What can I do to have them as links instead? thank you function thb_display_category_cus() { if ('portfolio' === ...
0
votes
1answer
19 views

Possible for Category Base and Custom post Type to share the same slug/permalink?

Rebuilding an author/writer website in WordPress. I have a custom post type of books. Working OK. I'd also like my category base to be books. Not working as yet. So a book URL would be like: https:...
0
votes
1answer
32 views

Get_term_meta() does not work with pre_get_posts()

I am trying to get custom term meta value for a certain category using get_term_meta() function. This value is stored in the wp_termmeta table. Then, based on that value, I want to modify the main ...
0
votes
0answers
12 views

I want to print categories and sub-categories and so on

I want to print categories and sub-categories and so on in way that it looks like. cat1 cat2 cat3 cat1.1 cat 1.2 cat 1.3 cat1.1.1 cat1.2.1 cat1.3.1 It looks like menu I have ...
0
votes
0answers
14 views

Get_term_meta() always returns false

I added an extra field (dropdown list with select options), when the user creates or edits a category from the WordPress dashboard. I am also able to store the selected value in the wp_termmeta table. ...
0
votes
1answer
17 views

How to sort post category using its Description

I Am trying to sort my custom post categories according to its description. I tried below args but it did not work $taxonomies = array( 'post_tag', 'product-type', ); // Add the slugs of ...
1
vote
2answers
35 views

How to remove “Category : …”

I am using theme Twenty Sixteen. I created a menu using categories, and when I click on one and end up on a category page that has a "Category : ..." title. I would like to remove that title so that ...