i want to add “tag” filter to my category widget. but it is not working. when i add is_tag('specialtag')
or has_tag('specialtag')
its getting nothing on page.
my widget seems like that ; https://i62.tinypic.com/wugvlw.png
https://www.ads-software.com/plugins/widget-logic/
]]>See the code:
<?php if( is_tag('destaque')): ?>
<?php $posts = get_posts('numberposts=4'); foreach($posts as $post) { ?>
<h2><?php the_title(); ?></h2>
<?php } ?>
<?php endif ?>
Does somebody knows how to do that? Am I doing something wrong?
Thank you all.
is_tag( 'mild' );
// When the archive page for tag with the slug of 'mild' is being displayed.
is_tag( array( 'sharp', 'mild', 'extreme' ) );
// Returns true when the tag archive being displayed has a slug of either "sharp", "mild", or "extreme".
Does anyone know how to modify the function of WordPress so that it will return true when the tag archive being displayed has the slugs “sharp” and “mild” and “extreme” ?? I need all three slugs to return a true. If there are either of the two slugs, or if there is only one of the slugs, then it returns false.
Is this even possible to do with WordPress?
]]>Thus, is_category() returns true…
==> Question: how to get THE category which is being displayed?
Imagine
You’re on a website, and it’s currently showing a tag page.
Thus, is_tag() returns true…
==> Question: how to get THE tag(s) which is/are being displayed?
Noobie question but I need it =)
]]>I know little about the inner-workings of PHP (as will become apparent momentarily) but here’s what I want to do…
Using the archive.php page, I would like the tag archive page for the tag the list (slug: the-list) to be the only archive page of any kind to display the full post content in the results.
Currently, I have eliminated the template tag
<?php the_content('[Read more →]'); ?>
between
<?php while (have_posts()) : the_post(); ?>
and
<?php endwhile; ?>
so that the list of any archive is neat and clean, necessitating one to click the title of the post in the list to get to a post’s permalink page.
Here’s the code for my current archive.php page…
…and here is the last messed up code I tried for archive.php,in order to get it to do what I wanted…
It didn't work. Any help would be greatly appreciated.
]]>I put in all the conditionals up to a point and had them out put when they were true at the bottom of my sidebar. is_tag does not return true and my tag cloud does not get displayed for tag archives.
This is a blog started in 2005 so it has been updated many, many times, most recently to the 3.2.1 code base. Besides plugins that don’t get along or function as advertise my blog is working as expected though I put a lot less work into customizing it than I used to. I’ve also taken to blogging at WordPress.com about specific topics as my blog is big and bloated and unfocused. I’d like to get the sidebar functioning as expected you can see the wacky behavior here:
]]>for instance if the tag dog is used i would like to make a link to a dog page
i thought i could use is_tag but that does not seem to work.
Any suggestions?
Greetings,
George
Can I use a function for it?
Something like … if is_tag (communication) get_url (https://) …
Php is new for me, can someone help me out.’
ps: the taxonomy is used in a custom post type
]]>[Code moderated as per the Forum Rules. Please use the pastebin]
I am using the SemiLogic Theme and put that code in a widget but it showed on all pages and posts. If were just all posts it would have been better but I am hoping that with the right use of the has_tag I will be able to call it for specific posts.
Thanks
]]><?php if (is_tag('example')) {
JS AD CODE HERE
}
else { ?>
ALT JS AD CODE HERE
<?php } ?>
Thanks in advance!
]]>