Questions tagged [tags]

The built-in taxonomy 'post_tag'.

Filter by
Sorted by
Tagged with
1
vote
2answers
24 views

Don't show a tag on a post if it is the only post with that tag

At the bottom of a post, I show all that tags that post has. If the current post is the only post with tag X, then I don't want tag X to show in the list. Because if someone clicks on that, they'll ...
1
vote
1answer
31 views

How to make tag post listing page working?

I'm adding tags to posts. Clicking a tag takes you to an overview listing of all posts for that tag. I created this listing by adding template "tag.php", which includes: $tag = get_queried_object(); ...
0
votes
1answer
120 views

Allow user only create specific tags

I am using an editorial wordpress theme that has a frontend post editor for a user (contributor) to create a post. The editor is giving permission to the user to choose category for the article and to ...
1
vote
0answers
31 views

I can 't display product images based on the label

The task is as follows. We have a product card template in Elementor, we have products with tags. The task is to use the Portfolio tool to display images of products that belong to the same label as ...
1
vote
0answers
65 views

Force Contributors to add Tags via edit-tags.php

I need to be able to stop contributors to the website from adding new Tags when they create or edit a Post in WP. The reason is that I need them to enter an additional field at the same time which I ...
1
vote
0answers
17 views

I want to add a new tag to Wordpress URL permastruct

I installed a TV SHOW plugin on my WordPress install. URLs are like this: https://www.mywebsite.com/tv-show/title-of-tvshow Now I would like to add a specific tag to redirect the user to the right ...
0
votes
1answer
481 views

CPT tags not showing when editing post

Since Gutenberg I've used the plugin "Classic Editor" for one of my websites until I have time to make the necessary adjustments to fully work with the new Gutenberg look. I'm now starting to look at ...
0
votes
1answer
182 views

Replace <p>-tag in the_excerpt

I want to replace the -tag around the_excerpt. Right now html-output looks like this: <p> ...content of the excerpt... </p> I want to achieve this: <h2> ...content of the excerpt......
0
votes
0answers
31 views

How to prevent tag “iframe” from being deleted from the heading description of rubric?

I can’t insert html tag "iframe" in the description of the rubric/categories. The tag is deleted along with the content. How to prevent tag "iframe" from being deleted from the heading description?
1
vote
0answers
878 views

Pagination is not working properly in Product Category/Tag pages

I have a store with several products. Pagination works fine on the main shop page. But when I open a separate product category or product tag pages, in some of them pagination not working as expected....
0
votes
1answer
111 views

Echo text using is_tag

I've been trying to echo some text to all single pages that are part of tag_ID 129 This is the code that I used <?php if ( is_tag( '129' )){ echo '<p> test 2</p>'; } ?> so ...
0
votes
3answers
323 views

Hide specific category tag on single post page

I have a category called "Featured", but I don't want this category tag to be shown at the bottom of single post pages. I do want to display the other category tags. How do I hide the tag for this one ...
0
votes
1answer
24 views

Suddenly extra hex string in <script> tags

By accident I saw that a hex string is added to all <script> tags. Example: <script src='https://example.com/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp' type="...
1
vote
1answer
64 views

Wordpress editor: “pick from existing tags” is gone?

In the olden days of Wordpress, I could compose a new post and pick from existing tags using the "Tags" section in the right sidebar. With the current editor, that "Tags" section still lets me enter ...
0
votes
0answers
588 views

Filtering posts in category by tag URL

I'm still learning WP, so this might seem pretty obvious to veterans. I've been given admin rights to a WordPress site and told to replicate what my predecessor did with a specific pair of pages. ...
0
votes
1answer
39 views

echo $category[0]-> cat_name; shows only one category name

I have this code: <div class="row"> <div class="col-lg-12 post_meta"> <ul> <li> <p class="meta-txt">Category</p> ...
0
votes
0answers
14 views

clicking on the_tags() generated tags to show all tagged posts page

I'm start using the_tags() function, I want to create a list of tags using the # symbol like the hashtags. I've never used this function, and I've noticed that it will create a link to an url that is ...
0
votes
1answer
27 views

Css and function issue on author archive page

my posts doesnt seem good.Also I want to display comment counts and tags of post.How can I do it? http://www.migrate2.deniz-tasarim.site/author/admin/ <?php get_header(); ?> <style>...
0
votes
2answers
104 views

Generate images to be associated for tag and category?

I’d like to generate images suitable to insert into metadata (like Open Graph or twitter:image). Basically I want to create a collage based on posts for each tag. So let’s say I had the tag “cats” ...
1
vote
1answer
500 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
65 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
1k 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
557 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
39 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
33 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
1
vote
1answer
2k 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
3answers
55 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
40 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
48 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
44 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
72 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
20 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
26 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
262 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
334 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
1answer
71 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, $...
1
vote
1answer
162 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
33 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
1answer
21 views

Wordpress Search by tags

How can I set by using functions.php, Wordpress search that the searching be only by tags.
0
votes
1answer
246 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
90 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
41 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
392 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
29 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
23 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
25 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
52 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
496 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
1answer
20 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
2k 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 ...

1 2
3
4 5
26