Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tags]

The built-in taxonomy 'post_tag'.

0
votes
0answers
22 views

Why doesn't the_tags( ) accept empty string for first argument?

Why doesn't the_tags( ) accept empty string for first argument? It accepts this: the_tags( 'Text: ', ', ', '' ) But not this: the_tags( ' ', ', ', '' )
0
votes
0answers
22 views

Display all tags even if they are not assigned to a post

Tags will not display if they are not assigned to a post/page. Is there a function that will allow a tag to be displayed when it is not assigned to a post or page? example: If you click on the "...
0
votes
1answer
16 views

Any way to make custom taxonomy field searchable?

I have added custom taxonomy field on tags, but when I search that field search is not working. Any way to make it searchable in WordPress dashboard?
0
votes
1answer
20 views

How to get tags with custom taxonomy field?

I have added custom taxonomy fields on tags but when I use get_tags() it does not return custom field. Right now I am using get_term_meta() for custom field but I have 4000 records of tags so when I ...
1
vote
1answer
25 views

Group posts by custom post type

I created a custom post type called Game, and created 3 posts under it, Game A, Game B and Game B. I also want to create more posts, like guides and tutorials, for Game A, is thre a way to group ...
0
votes
1answer
17 views

Changing Post Tag Color Based On Post Count

I have post tags that must always display. I want to change the color of the tag if there are no posts. I am looking for guidance on how to find the count and change the color of the post tag link ...
1
vote
1answer
22 views

How to make a custom taxonomy selectable in post publish area?

I registered a new taxonomy: function all_about() { register_taxonomy( 'all_about', array('post'), /* if you change the name of register_post_type( 'custom_type', then you have to change ...
0
votes
1answer
24 views

How to add independent “Tags” to Custom Post Type?

I'd like to create a custom taxonomy called "Tags", just like the native one that can be found on Posts, with the same name/slug but independent from it: 'taxonomies' => array('post_tag') I know ...
0
votes
1answer
31 views

Filter Tags for current users

I have a custom post type call question which have custom taxonomies which is called question-tags. These question tag further used for creating dynamic quiz. I want to restrict users to use question-...
0
votes
0answers
20 views

How to select tags in the frontend

Please help. I want users to be able to add posts from the frontend. It works for me, but I do not know how to do it to choose one of the existing tags. I have this code (used from here, but ...
0
votes
0answers
19 views

Filter posts with tags of the attachment?

Is there anyway I can filter posts with the tags of the attachment? I'm pretty new to wordpress. Current arry: $args = array( 'post_type' => 'post', 'post_parent' => $post->ID, '...
0
votes
1answer
21 views

Change Size of P Tag on One Page Template [closed]

I have two blog types on my website (Blogs and Updates). I need to change the P tag font size in both page templates. These are the page templates that show a list of the posts/articles. Blogs page (...
0
votes
1answer
18 views

show recently added tags to tag cloud

Is there a way to show the most recently added tags to tag cloud? Do I have to use the https://developer.wordpress.org/reference/functions/wp_tag_cloud/ thank you
1
vote
0answers
48 views

How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?

I want to use Categories and Tags everywhere in WP (Articles, Pages, Attachments and CPT like for example Jetpack-Portfolio) I have been able to show these 2 core taxonomies (category and post_tag) ...
0
votes
0answers
9 views

How to add thumbnail from portolio_tag?

How can i add the thumbnail from portfolio tag? im adding my cloud tag like this: $terms = get_terms( 'portfolio_tag' ); $count = count( $terms ); if ( $count > 0 ) { echo '<h3>...
0
votes
0answers
12 views

Add category to curent category filter - link

I want to place a link to a category (cat2) on the page MySite.com/category/cat1/ that takes you to MySite.com/category/cat1+cat2/ But if you already are on MySite.com/category/cat3+cat1/ I want it ...
0
votes
1answer
17 views

add_action pre_term_description vs. pre_category_description

I am trying to set a default tag and a (different) default category description in case there is none given on creation. I have found the action "pre_category_description", but no equivalent for the ...
0
votes
1answer
58 views

Sync All Post Type Tag

I have a few post types in my website. Is it possible that all post type using the same post tag? For example: PostType A have a "Apple" tag. PostType B, PostType C, PostType D use PostType A "Apple" ...
0
votes
0answers
15 views

Related posts by many fields with OR - WP Query

I would like to have related posts on my webpage. The idea is to show everything that is related to this post, so the author could be the same, tags or category(I assume that post have only one) - ...
0
votes
1answer
7 views

Inserting article:tags meta in html head-element, using get tags, no wp_head

I´m trying to add code to a template file of mine, working with a raw theme I generated from “”. The file is a duplicate of single.php and called single-post.php. Like WP states in Codex. I am trying ...
1
vote
1answer
14 views

Please help me to figure out how to display my tags

desperately looking for help. Have a Wordpress theme which does not display post tags on a single page and I badly need to have them there. Developers only named a file which needs to be modified. It'...
1
vote
2answers
39 views

Exclude specific tags (by id) from the_tags

Within a single post I show all tags of the specific post by using this: the_tags( $tags_opening, ' ', $tags_ending ); But sometimes I mark a post with a tag that should not appear on that single ...
0
votes
0answers
24 views

I've created custom post type 'players'. How do I tag built-in posts with these players?

I just create custom post type -> Players for creating player profiles. Now I need to tag those player profiles in my post as/like tag or category.
1
vote
1answer
19 views

Is possible add icon in title posts only in specific tag?

I want to add an icon in title posts only in posts with specific tag. Is this possible? I've already tried these codes, but they didn't solve my problem: Approach #1 if (is_tag('162')) { ...
0
votes
1answer
18 views

getting posts by tags

i use below code for getting posts by word tag $search_songs = array( 'posts_per_page' => -1, 'post_type' => 'songs', 'tax_query' => array ( array ( ...
0
votes
1answer
9 views

getting custom post by tag

i getting custom post by tag - my cod : $search_videos = array( 'posts_per_page' => -1, 'post_type' => 'videos', 'tag' => $search_query ); $new_query = new WP_Query( ...
1
vote
1answer
8 views

how can i add all my tags to tagcloud?

Hello i would like to show my all tags as a tagcloud . But i want to show all my tags some of them i added manually and they are not connected with any article? Is there any way to do it this code ...
0
votes
0answers
36 views

Woocommerce showing only one product on main shop page of the exactly same tag

I have more than 3000 products on my website. I get all products from main dealer's database using XML importer. Anyway, i assigned same tag for the products of same type. For example, i have a oval ...
0
votes
0answers
32 views

How are special characters encoded in tag-URL?

I am trying to get the right link to Tag-Pages/Archives with JS out of the tag name. For the tag "abc" I can use ?tag=abc. But for "$$" neither ?tag=$$ nor ?tag=%24%24 (used encodeURIComponent) work. ...
0
votes
1answer
30 views

How do I tag every author in their posts that they have made previously

So here is the situation, I have a wordpress blog site that is a few years old, and every user had a different account to post with. Now what i want is a plugin/script that automatically adds the ...
0
votes
1answer
30 views

Changing input type from text to multi select dropdown - skill taxonomy

Really need help with a wordpress code please. I have a field on a form which adds tags to the post. Problem is, its free for anyone to enter anything. This keep populating the "skill" taxonomy. The ...
-1
votes
0answers
16 views

Wordress Front-end post category array

I have been trying to build a front-end form to wordpress post. I am using a custom post type but not a custom taxonomy, and these works fine. I am doing this with the wp_insert_post function, trying ...
0
votes
1answer
24 views

How to add a class to anchor tags using the get_the_tag_list(); function? [duplicate]

What's the easiest way to add a class to the anchor tag using the get_the_tag_list() function? For example by adding; if(get_the_tag_list()) { echo get_the_tag_list('<ul><li>','</li&...
-1
votes
0answers
23 views

Display tags icons on Woocommerce shop and product pages

I want to dispaly tags icons on Woocommerce shop page and on single product page. Can't find appropriate code to use for that, can you help me with that?
0
votes
0answers
16 views

Wordpress, query by tag as in /?tag={tag_id}

Right now, my wordpress site queries tag pages as /?tag=tag-slug-here But I want to make sure it's doing this by it's term id, not by its description/slug So when I tried replacing it with term id, ...
1
vote
1answer
28 views

Display tags with random thumbnail from selection of posts with that tag

What I want to achieve consists of two parts: First a set of containers that display each tag (with name, description and link). This is easily achieved with a get_tags and foreach loop. <?php $...
0
votes
0answers
11 views

pass first tag and first category variables into html string

hope you can help. I'm trying to get first 'tag' and 'category' variables to be passed in html string, but it's not working. Any ideas why this code below isn't working. Probably something glaringly ...
0
votes
0answers
23 views

Hide products with a certain tag from shop/homepage

for our ecommerce webshop we would like to exclude certain tags from the home page (shop) and the shop page. The tags should be visible on all archive and category pages. In another article I found ...
0
votes
0answers
32 views

how to remove only parent tag from post content?

I have following html stored in my post content and I want to perform some operation on that content using php dom parser.here is my html <div class="waterfall_new_layout"> <...
0
votes
0answers
18 views

tag based subscription

I have different tags based on products, I want that when new post published then only attached tag's subscribed people will get mail. If this is possible with category then I am fine with changed my ...
0
votes
1answer
23 views

Change the color of post title on specific tags

I have running site with many categories, I don't want to mess around with code... I am thinking to add a condition to make -for example- the post title as red if the post has a tag "football", and ...
1
vote
1answer
27 views

Redirect All Search Links Containing - to + on Wordpress

I deleted all my wordpress tags via phpmyadmin, and most of my post content contains tag links, now I redirected all the tag links to search using .htaccess, I.E example.com/tag/stack-exchange/ ...
0
votes
1answer
19 views

Query posts that have all the specified tags

I have tried this one for example: $query = new WP_Query( array( 'tag__and' => array( 37, 47 ) ) ); It doesn't seem to work. Am I wrong in thinking that category and tags are the same relative to ...
0
votes
1answer
21 views

the_excerpt displaying code inside style tag

I created a custom visual composer element where I included a style tag on it to use the chosen color to create hover effect. And this code is now displaying in the the_excerpt in the search result ...
0
votes
1answer
50 views

Hide a product with a certain tag from product-category

I am trying to make products with a certain tag disappear completely from the store, including when customers are browsing categories. In another question I found this function that help me hide ...
2
votes
2answers
68 views

Query all posts and not repeat the same tag

I need a query to show all posts in the site but not repeat the ones with same tag, I mean only show one post with the same tag. My current query is <?php $paged = (get_query_var('...
4
votes
3answers
396 views

Stop WordPress From Removing HTML Comments In Content

Whenever I switch from the visual editor to the text (HTML) editor and put an HTML comment in the code, e.g. <!-- this is a comment-->, WordPress removes it, either after saving the change or ...
0
votes
0answers
44 views

List tags and pagination

I have a custom template page where I display all TAGS used in the site. In my case I use them to show the author name. The way I display them is... <ul> <?php $tags = get_tags()...
0
votes
0answers
10 views

Search with WP_Query, but ignore href URLs in anchor tags?

I've got a plugin which searches for related content using WP_Query. However, I'd like it to ignore words in the URLs of hyperlinks within articles. So for example, if I have this content on a page: ...
1
vote
1answer
28 views

How to show posts with multiple tags on tag.php?

On my tag.php page, I want to show posts with multiple tags... I have something like this: mypage.com/tag/tag1+tag2+tag3/ $tags = get_queried_object()->slug; //returns only 'tag1' !! $args =...