I’ve searched the forums and Googled, but haven’t had any luck finding a solution to my how-to question. It could be that I’m going about it all wrong, so I’m open to ‘best practice’ solutions too.
Apologies for the long post, I just wanted to explain it as thoroughly as possible. The site is in development locally, so unfortunately I’m unable to provide a link.
I have a page template which uses multiple queries to display one post per a selection of tags.
For example:
$thistag = new WP_Query('tag=this-tag&showposts=1'); if ($thistag->have_posts()): while ($thistag->have_posts() ) : $thistag->the_post(); get_template_part( 'specialtags-loop' ); endwhile; endif; wp_reset_query();
$thattag = new WP_Query('tag=that-tag&showposts=1');
if ($thattag->have_posts()): while ($thattag->have_posts() ) : $thattag->the_post(); get_template_part( 'specialtags-loop' ); endwhile; endif; wp_reset_query();
$anothertag = new WP_Query('tag=another-tag&showposts=1');
if ($anothertag->have_posts()): while ($anothertag->have_posts() ) : $anothertag->the_post(); get_template_part( 'specialtags-loop' ); endwhile; endif; wp_reset_query();
My loop is just a standard WordPress loop, and correctly displays a list of posts comprising one of each of the requested tags:
Post Title
Post ExcerptPost Title
ExcerptPost Title
Excerpt
What I want to do (if it’s possible) is display the ‘nice name’ of each queried tag, without having to resort to hard-coding each tag name individually – just to differentiate between the posts. Most of my posts have multiple tags, which is why I’m trying to get it to display the queried tag only.
What I’d like is for the page to show something like:
This Tag
Post Title
Excerpt
Read more from This TagThat Tag
Post Title
Excerpt
Read more from That TagAnother Tag
Post Title
Excerpt
Read more from Another Tag
Hopefully this makes some sense, and hopefully you can help. Much appreciated.
]]>< ?php single_tag_title(''); ?>
I would like to make a custom taxonomy page exactly the same as the tag page displaying the single custom taxonomy name.
taxonomy.php isn’t working, neither is taxonomy-sheds.php
For example… This is an example of my tag.php
https://www.outdoorinnovators.com.au/patios/parklands/
And this is an example of my taxonomy.php page that doesn’t work for some reason…
https://www.outdoorinnovators.com.au/sheds/belmont/
Any help appreciated
]]>In essence the tag is acting like a parent category.
I can list all the posts which have the tag no problem but I can’t seem to filter the categories.
So I’m looking to display…. just for example
Tag – Germany (page)
Mercedes
-Car 1
-Car 2
-Car 3
Audi
-Car 1
-Car 2
-Car 3
BMW
-Car 1
-Car 2
-Car 3
I can’t set Germany as a parent category (which would be soooo much easier I know)
Any ideas…
]]>I was just wondering if anyone came across this. I’ve searched online, but couldn’t find the right information I am looking for.
I am using the jQuery Quicksand plug in to re-order my thumbnails of posts. Similar to https://razorjack.net/quicksand/. This uses classes to identify which post’s are associated with a specific tag.
What I’m trying to do is list the tags that are associated with the all the posts. (Only have 3-5) While listing them I want to add a class (for example “class=”single-tag””)
Then while I’m going through the WP loop I want to add a class of any tags associated with that individual post to the post div that holds the entire content of the post.
Any ideas?
Cheers,
Simon
I am trying to do something like this:
<?php $posttags = get_tags(); ?>
When I use the_tags(), it prints out the data but I want to store just the tags in a variable like:
<?php $tags = “tag1,tag2”; ?>
Thanks in advance for your help.
]]>