Tag Info

Hot answers tagged

1

Use tag__not_in parameter. You have to use tag ID for this parameter $args = array( 'category_name' => $cat_name, 'tag' => $tag_name, 'post__not_in' => $sticky, 'tag__not_in' => array($tag_id_1, $tag_id_2) ); $my_query = new WP_Query( $args );


1

I think you should check for some other platform. WordPress is made to be live all the time : ) But if you are really keen in doing it in WordPress I can suggest a hard way of doing it. You can use the JSON-REST-API for WordPress and jQuery Mobile to build a mobile app that will run on any browser (not only mobile browser). Thank with cache manifest and ...


1

The code below assumes that only one tag ( 'private' ) has a text associated with it: function add_tag_text_to_title( $title, $id = null ) { if ( has_tag( 'private' ) ) { return $title . ' - Awesome'; } else { return $title; } } add_filter( 'the_title', 'add_tag_text_to_title', 10, 2 ); If you have more than one tag with text ...


1

Your code has a couple of flaws which I'm not going to go into detail now. Here is a short list pre_get_posts is an action On any type of archive page you need to make sure you only target the main query and the front end when using pre_get_posts Your syntax is very hard to debug and not supported by most code editors. Although if (): else : endif; is ...


1

For non-hierarchical terms (such as tags), you can pass either the term name or id. If you pass the id there is only one caveat: You must pass it as an integer, and it must be in an array. This is necessary because any non-array value passed will be converted to a string, which will be interpreted as a term name. $tag = '5'; // Wrong. This will add the tag ...



Only top voted, non community-wiki answers of a minimum length are eligible