Adding post tags without capability edit_posts
Adding post tags without capability edit_posts
Adding post tags without capability edit_posts
Strip and tags from a specific div
post_class() is a wrapper around get_post_class(). Try the following hook post_class which is fired from get_post_class() within wp-includes/post-template.php: add_filter(‘post_class’, ‘filter_post_class’, 10, 3); function filter_post_class($classes, $class, $post_id) { $temp = implode(‘ ‘, $classes); $temp = preg_replace(‘/\s\btag\-\w*\b/i’, ”, $temp); return explode(‘ ‘, $temp); } Alternatively (RECOMMENED): add_filter(‘post_class’, ‘filter_post_class’, 10, 3); function filter_post_class($classes, $class, $post_id) { $classes = … Read more
So one way this can be done is by creating a filter to check for a custom query string parameter that represents a tag name or names. I added a function similar to this to my theme. It modifies the global WP_Query object before a request is made for posts by the REST API. add_filter(‘pre_get_posts’, … Read more
You will certainly receive many answers. This question is very good. We are speaking about the tags when you try to type them for a new post, for instance in the Dashboard. When you type the tags, you get the proposals. I think this is a good feedback. However, it could be possible to create … Read more
Actually the code is working, its just hiding the empty tags. So you better populate the tags named with å, ä and ö or you can add the line hide_empty => false to the argument. And then the code will be like below- <ul> <li> <h3>Ö</h3> </li> <?php $tags = get_tags( array( ‘name__like’ => “ö”, … Read more
TinyMCE – how to select tags node from the place where the caret is?
The easiest way to pull data from another site is by using the Rest API. The interface is not as powerful as WP_Query in terms of the arguments you can pass to the query, but you can still do something like this: $json = file_get_contents(‘http://example.com/wp/v2/wp-json/posts?tags=11&per_page=5’); $posts = json_decode($json); The $posts variable now contains maximum five … Read more
You can use the WP function the_tags(), more info here. You will have to figure out where exactly in your content-single.php to put this but you want to add something like this… <p><?php the_tags(); ?></p> View the link above for more examples.
why don’t you try: function tag_count( $tagatts ) { $tagatts = get_terms( array( ‘taxonomy’ => ‘gd_place_tags’, ‘hide_empty’ => false, ) ); $tagatts_count = count ( $tagatts ); return $tagatts_count; } add_shortcode( ‘tag_count’, ‘tag_count’ ); it should actually return the term count. I’m just using php for Count instead of a wordpress function.