Questions tagged [get-the-tags]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 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 ...
2
votes
1answer
100 views

How to show tags in posts, orderby count(most used) not alphabetically?

I would like to show most used tags first in single post page, archieve page and on homepage. For example: I have 4 tags- Ball(5 posts), Doll(3 posts), Cat(2 posts), Apple(1 post). Whenever I put ...
0
votes
3answers
81 views

Show posts from categories instead of tags

I am trying to change this wordpress function given in my theme to show posts from category instead of tags. But due to wordpress beginner i am unable to do this. Please help me to change this code....
0
votes
0answers
69 views

method to fetch entire tag list on archive.php

What I have Tried → <?php $taginto = get_the_tag_list(); if ( ! empty( $taginto ) ) { echo '<a class="categum" href="' . esc_url( get_tag_link( $taginto[0]->term_id ) ) . '">' ...
0
votes
1answer
9k views

How to display WooCommerce product tag names on home and category pages

I am trying to display WooCommerce product tags on the home page and category pages. Along with the product title the theme should display any tags in alphabetical order, separated by a “·”. For ...
0
votes
1answer
22 views

Dynamically getting tags in post edit screen

I am trying to dynamically get the post's tags as the user adds them while editting a post, but I have not found any hook related to that action. I know I can make my own hooks, but the thing is that ...
3
votes
4answers
2k views

How to display the_tags() as plain text

the_tags by default is displaying as URL. I need to display it as plain text to insert inside HTML attribute. <?php $tag = the_tags(''); ?> <div class="image-portfolio" data-section="&...
0
votes
1answer
125 views

Show Tags of Custom Post Type outside of Loop

I have a custom function that someone else here help me build that shows custom post types on my front page. I want to add the tags/tag-links of each post to it, but whenever I reference get_the_tags(...
2
votes
1answer
47 views

Related Tags Concept

On search results pages I would like to show a tag list collected from other posts that are listed for the seach result. // same tag should not be listed twice And for the taxonomy pages again; tags ...
0
votes
1answer
834 views

Display posts with tag for custom post type only

I have this is my functions.php file to create tags only for custom post type called 'image-gallery': register_taxonomy( 'image-gallery_tags', 'image-gallery', array( 'label' => ...
0
votes
1answer
632 views

How can i order get_the_tags?

I have the following code which works exactly as i'd like it to, but the displayed tags are in reverse alphabetical order and i'm not sure how to sort. I've noticed that the_tags has an argument ...
0
votes
0answers
111 views

get_the_tags function not retrieve all tags for specific category

I use this code below to retrieve all tags from a specific category. The code is working correctly, but only returns three tags in stead of all tags (I assigned six tags for this category). These ...
0
votes
1answer
491 views

Include tags from array, ignore the rest in get_the_tags

I'm trying to exclude a large amount of tags from being displayed in get_the_tags function. I have successfully excluded tags using this code: <?php $links = array(); foreach (...
0
votes
0answers
85 views

Getting Post Tags From Certain Categories

The site I am working on has about 4 different post categories. I need to output a list (unordered) of tags in that category so that a user can click on them and see posts in THAT category tagged with ...
4
votes
3answers
388 views

Better way to get tag stats?

I have over 4000 posts. I am trying to query all the posts and get the count of tags each post has and sum up posts count based on number of tags the post has in dashboard. The posts count shows up ...
0
votes
1answer
792 views

Create dropdown menu of all tags used in category

I'm attempting to create a tag-based filter on a category page, so I only want to show those tags that are used by posts in that category. I've got it mostly working, but the list isn't coming out ...
-1
votes
3answers
1k views

Tags outside the loop

I want to display the tags of the posts in my main page. I used: global $post; the_tags(); But it's only showing up for my FIRST page.
0
votes
1answer
4k views

WP Query with multiple tags by get the tags

I need to do a wp query that will get any post that has one tag or more. My current code works for one tag, but I've try for multiple with the codex and I can't do it. Can you help me? <?php ...
0
votes
1answer
510 views

How to get tags and categories?

I used the following code to get tags from the post and then simply echo them: $posttags = get_the_tags($post->ID); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ', ';} ...
0
votes
1answer
317 views

wordpress str_replace the content with tag

it is possible to find tag in the content and replace with link? function replace_content($content){ foreach(get_the_tags() as $tag) { $out .= $tag->name .','; $csv_tags .= '"<a href="...
0
votes
1answer
260 views

Retreive tags from attached post for media on page

I am working on a custom template file that pulls all images in my Media Library with a specific tag. I was able to get this working with some help from the community, it also shows the title of the ...
0
votes
1answer
101 views

data-type=“” … needed post tags stripped of characters

So I am trying to generate a list of post tags on the data-type attribute but I need them to be sanitized so spaces are replaced with underscores and there are no special characters... really ...
0
votes
1answer
130 views

Author Link Not Displaying

I have used this with "echo" as its outside the loop i believe to the author of the post as a link, however its not displaying as a link? <h2 class="sidebarheaders">Random Posts By You </h2&...
1
vote
1answer
411 views

list tags with count in author profile page

I would like to list tags with count in author profile page just like this page If the user click the tag, then I would like to list the tagged posts. Can someone help me?
1
vote
2answers
7k views

get_the_excerpt() not returning anything when post has no excerpt

When trying to call get_the_excerpt() the page does not return anything on posts that have no excerpt. I thought WordPress usually 'fake' it and create one using the first x characters from ...
3
votes
2answers
2k views

Exclude Tags from get_the_tags

While following this article to get tags by date, I was wondering if I could exclude certain tags from what gets returned. The point is to have trending tags but some tags will always be there and I ...
1
vote
1answer
324 views

Get posts inside Get terms problem

i have a get_terms which loads correctly. inside of it i have used get_posts. then using get posts i am trying to get each post tags (and count <= not currently inside this script) <?php $...