Change Post Class function

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

Limit tag selection to predefined list

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

Cross Site Related Posts?

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

Get count of custom post tags

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)