Exclude specific tag or tags from related posts?

The Codex has almost exactly what you are asking: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘movie_genre’, ‘field’ => ‘slug’, ‘terms’ => array( ‘action’, ‘comedy’ ) ), array( ‘taxonomy’ => ‘actor’, ‘field’ => ‘id’, ‘terms’ => array( 103, 115, 206 ), ‘operator’ => ‘NOT IN’ ) ) … Read more

Listing tags with custom html output

I tested your code and it’s working. So you maybe have somewhere else an error. Try var_dump($tags); and see if there’s content. Did you created some tags and assigned them to posts?

Tags as autocomplete values

if(isset($_GET[‘get_tags’])): $output = array(); foreach(get_terms(‘post_tag’) as $key => $term): // filter by $_GET[‘q’] here if you need to, // for eg. if(strpos($term->name, $_GET[‘q’]) !== false)… $output[$key][‘value’] = $key; $output[$key][‘name’] = $term->name; endforeach; header(“Content-type: application/json”); echo json_encode($output); die(); endif; in this case your js would be something like: $(“#input_1_3”).autoSuggest( “http://yoursite.com/?get_tags=1”, {selectedItemProp: “name”, searchObjProps: “name”});

How to retrieve the post_id of a tag page?

A tag page would be like other archive pages in that a loop of posts would be displayed, even if only one post has been assigned that tag. You’re check for post ID needs to happen during the <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> loop.

How to list Tags using get_tags in an html table?

This is what I tried and it works well. I am using array_chunk, but I’m also adding a check to see if a chunk has less than 4 values (as you want 4 columns), then just add a blank <td>, which will avoid the mark up from breaking. <?php $tags = get_tags(array(‘hide_empty’ => false)); $tag_groups … Read more

How to make a Post Tag primary?

Looks like someone on on of my listserves provided the answer: He said to, “use innerHTML() within your ajax callback function. It looks like you’re using jquery, so use the .load() function.” I checked on the jquery site and it said .innerHTML is .html in jQuery, so we’ll go with that then and see if … Read more