A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [tags]

The built-in taxonomy 'post_tag'.

Filter by
Sorted by
Tagged with
0
votes
3answers
28 views

Is there anyway to call woocommerce product tag in product description? [closed]

I would like to call product tag in product description as shown in image. Anyone can help with that plss I am using woocommerce.
0
votes
1answer
36 views

Adding country tags automatically

I want to show country flags on post cards.My plan is showing flag icons with below code: <img src="/icons/<?php echo $tagName; ?>.png" /> However I dont know how can I add country tags ...
1
vote
1answer
26 views

Wordpress Related Post by tags in Single.php

I want to create a related post, but the code I tried shows only related post using only the first tag. I want related post which use all tags. (Because my site is a blog and each post can have up to ...
1
vote
2answers
23 views

A post has a js redirection script. How to not redirect its category?

I have a post in category A that contain this redirection script: <script>window.location.replace("http://www.w3schools.com");</script> However, when I click on A, it also redirects. How ...
0
votes
0answers
30 views

add tags to wordpress post using REST API

I'm new to WordPress programming and I'm trying to connect to WordPress REST API and send a new post with content and many tags. I can connect to API and send a new post but I can't add tags to those ...
0
votes
1answer
9 views

Remove part from dynamic url and redirect

How do can I redirect the following URL to the next URL? It essentially should remove the ID part (this is a post tag URL). http://wpsoup.test/tag/88/koffie/ -> http://wpsoup.test/tag/koffie/. I've ...
0
votes
0answers
16 views

Arrey by tag from edit page

i have very specific question, I need a option to add array from the editor edit page, i mean when you type text to page i need option to select tag and display all post with this tag. This is some a ...
0
votes
0answers
19 views

Trying to merge these two arrays

This code below shows categories and tags associated with the posts. It works well BUT if there are no associated tags then it throws this error: Warning: Invalid argument supplied for foreach() ...
0
votes
0answers
22 views

I want to display “how many times this tag used in Wordpress?”

I am trying to make a simple site but I need a help. 2-3 page has a same tag eg: apple-2019-projects And I want to display like that
0
votes
1answer
40 views

How to filter posts by specific date and its tag

I want to show the post dates of posts which is greater than $postdate value. what is the wrong with the following code? Instead of filtering the data by dates, it shows all the dates. I do not know ...
0
votes
0answers
13 views

Custom Meta Box (SELECT2) Giving Wrong Taxonomy Tag

I have update this code, Category taxonomy working fine, but tag taxonomy not working. /* * Add a metabox * I hope you're familiar with add_meta_box() function, so, nothing new for you here */ ...
0
votes
3answers
38 views

Setting color of specific menu items depending on page or post tag

I have a website that uses a plugin that lets me add categories and tags to pages. Is there a way of automatically changing the color of a menu item linked to all pages with a particular tag or ...
0
votes
1answer
36 views

Tag for custom post type

I have several post type (animal, science, car), I want all these posts type to use the same Wordpress default tag. exemple of car post type : // custom post type add_action( 'init', '...
0
votes
1answer
21 views

How to show entries related to main category

I have an entry with the following category and subcategory -Crops ---fruit ----papaya (Main) The problem is that when I show the related articles, it shows me all the entries of the category (crops)...
1
vote
2answers
31 views

Search the product by tag or category not working

I am working on search. I am trying to search the product by tag or category. I tried below code but it's not working. I am getting Nothing Found Also title and content is also not working. ...
2
votes
1answer
15 views

Making a list of post tags in string

I am trying to push post tags to the search index of the WPFTS plugin in order to search my posts by tag names. To achieve this, I have to generate a string with all tags. Here is what I tried: ...
1
vote
1answer
12 views

OG Meta Tags not being scraped by facebook or twitter

When trying to share a blog from my wordpress website on social media, (facebook, twitter), there is no URL preview card. No picture, no description, nothing. I installed yoast seo plugin on my ...
1
vote
0answers
20 views

Get link which associated with a specific category and tag

We have 500+ post, 60+ tags, 3 categories. We want to give link on header part which have specific one category and one tag. For example: We have multiple post like: Blanket, Blender, Mixer, Wardrobe ...
1
vote
1answer
22 views

How to get the Tags on Publish post hook?

Requirement: On the each publish/update post, we need all tags from the post and do some functionality on that. Case 1: Create post, add tags and Publish immediately === WORKS PERFECT === Case 2: ...
1
vote
1answer
16 views

Product Tags in Add New product as checkbox list [closed]

Id like to use product tags as a second classification for products from the Add New Product menu, however the product tag option in its default state is not reliable. Id like to customise it so that ...
0
votes
0answers
10 views

Hide certain tags from Gutenberg Tags Block (on a page)

I'm using the Gutenberg Tags block to show tags on an Archive / Search page that I'm building. I have some really old tags that aren't relevant any more but I don't want to show them on the frontend. ...
0
votes
1answer
28 views

How to display related posts from this code?

I have two scripts to display related posts that fit my terms, but I don't know how to call them, please help me. I found this code here. Related Posts 1: function get_pew_related_data($args, $...
0
votes
0answers
18 views

Widgets: quote of the day, text rotator, customizable tag cloud

I would like to have three widgets in my footer: 1) Quote of the day - every day would display a different quote from my own quote database. 2) How can you help us? - would display every few seconds a ...
0
votes
0answers
13 views

Add Gutenberg editor in post tag page and product tag page

i want edit tag page(blog tag page & woocommerce tag page) with gutenberg. I now add this code for editing product with gutenberg: function wplook_activate_gutenberg_products($can_edit, $...
0
votes
0answers
28 views

How to get Wordpress post filter (misha_filter_function) to filter CPT categories associated with a tag

I'm using the misha_filter_function from: https://rudrastyh.com/wordpress/ajax-post-filters.html to filter posts. The initial array is displaying the correct posts by the location_and_season (made ...
1
vote
1answer
31 views

Add 'data-text' attribute to TagCloud HTML

I am trying to add a data-text attribute to the selected tag in the TagCloud widget. I want to do this to highlight the selected tag. I have so far managed to add a class to it, but the reason I need ...
0
votes
1answer
23 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
13 views

Wordpress Search by tags

How can I set by using functions.php, Wordpress search that the searching be only by tags.
0
votes
0answers
27 views

Tags do not work

I can’t figure out how to add tag support to this code. Absolutely all posts are displayed on the tag page <?php $args = array(); $cat_id = ""; $queried = ...
0
votes
0answers
35 views

Prefix Wordpress Taxonomy Tags With Hashtag Symbol Like Twitter

How can I add a hashtag symbol before each tag in my WordPress website? My intent is that WordPress tags like 'Apple' should get converted to #Apple' I am the owner/developer of the site https://...
0
votes
1answer
34 views

Wordpress get tags in “publish_post” hook

I want to get the selected tags using publish_post hook, while publishing the post. With below code, I can get only those tags which are already saved in the post. this will not work for new tags. ...
0
votes
2answers
34 views

Get tags name under custom taxonomy in wordpress

I want to get/show only available tags under custom taxonomy. Here's my code; $tax = $wp_query->get_queried_object(); // print current taxonomy $args = array( 'post_type' => 'types', // ...
0
votes
2answers
29 views

How to show only specific tag in wordpress loop

I am trying to get the loop to show only two tag that have the ID 53 and 52. the code without the "if is_tag( array( 53, 52 ) ){" works. I tried different thing but I can't get it to work. Thank you ...
0
votes
1answer
16 views

Get X post tags

How to properly get only e.g. 3 post tags? My current code: $post_tags = get_the_tags(); if (!empty($post_tags)) { foreach ($post_tags as $tag) { echo '<a href="' . get_tag_link($tag-&...
0
votes
0answers
15 views

Exclude specific product tags from related products in WooCommerce 3.7.0

I use the following command line to exclude specific tags products from related WooCommerce products: add_filter( 'woocommerce_get_related_product_tag_terms', 'remove_related_tags1' ); function ...
0
votes
0answers
22 views

Tag pages with regular editor

So, I am creating a website, review products and attach dozens of tags to them dependent on what the product entails. I have a custom review template for my products and based on what I tag the ...
0
votes
0answers
22 views

Custom taxonomy named 'tag' return 404 page

I registered a custom taxonomy named 'tag', code below: add_action('init', 'reg_custom_tag'); function reg_custom_tag() { register_taxonomy('tag', array('my_custom_post_type'), array( '...
0
votes
1answer
28 views

`<!--:en-->` Language notation in the post content

Can someone tell mich which plugin usually handles the following notations, used to translate posts? <!--:en-->english text<!--:--> <!--:es-->spanish text<!--:--> Any way to ...
0
votes
1answer
111 views

How to get all the available post tags using the WP Data Module?

This is my first time working with wordpress, and right now I'm working with a legacy code, migrating some plugins to be gutenberg ready. There's a plugin that gets all the available tags in the ...
0
votes
0answers
6 views

(JSON) Query posts B,C,D,E,F by tags in Post A

I'm using WP query generator to create a JSON code for a WP plug-in which call post titles. But, for now, i have to type manually tag1,tag2,tag3 related to the displayed post to call other posts. {"...
0
votes
0answers
34 views

How to replace wp_ajax_add_tag() error notice on create_term?

I am writing a plugin which uses natural language processing and knowledge graph technology to determine the true entity type of terms added to WordPress, with the purpose of tidying up taxonomies. ...
0
votes
0answers
15 views

Listing only matched result line if specific tag and category is matched

For my Campus Project, I am developing a Travel based website where Touring Spots will be achieved and nearby Hospital, Shopping Mall and Hotel names will be listed on the following touring spots post....
0
votes
1answer
18 views

How to put a before and after with tags in a wordpress entry?

I'm trying to make two "before" and "after" buttons on each wordpress entry, but with related articles by tags. I have this code, but it doesn't work because it doesn't show me the related articles by ...
0
votes
2answers
181 views

Display all product tags associated with a specific product category

I need some help writing a shortcode to display all product tags associated with a specific product category which can be displayed on any page. My problem is that I can display all product tags ...
0
votes
1answer
80 views

How replace individual <category> elements in the RSS feed with a single <category> string

We're sending RSS emails out to our list and would like to include the categories and tags. But when we add them, due to the way WordPress delivers them, they just end up in one big long string/...
0
votes
1answer
14 views

How to convert Post Object Custom Field into Tags

so I've used this script in from this post to automatically convert an existing custom field into a tag. The problem is that my custom field is a Post Object. SO, it is creating a tag with the post ID....
0
votes
0answers
14 views

Sort posts by number of times tagged [duplicate]

Let's say I have a custom post type Books, and I tag the books with a custom taxonomy "Person". The taxonomy contains the name of a person and basically means the person has read that particular book. ...
0
votes
1answer
12 views

My theme is adding an unmatched end tag and outputting it to my screen

I use a theme that uses WPBakery - I have a feeling WPBakery might be the culprit here. I made a few small changes, and now this is appearing at the very top of the page, above the menu: " /> I ...
2
votes
1answer
46 views

associate custom post type with tags with specific pages

I have various products (custom post type) which already have categories but I have now I have added this line to be able to add tags to the products. 'taxonomies' => array('post_tag') So, I ...
0
votes
0answers
343 views

Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `wp_terms`

I have a wordpress site that has been working well for the past 6 years. Recently, I have been getting errors on: user creation tag creation I realized that user creation was yielding Duplicate ...