Sort tags by first letter or included number

From what I can read in your comments (and your follow up question), you are trying to intercept the WHERE clause of your query. The name__like argument you mentioned in your other question won’t work for what you are trying to achieve. The clause is built this way by get_terms() (the underlying function of get_tags()): … Read more

Outputting HTML elements through WP-API

I realised my mistake. The following line in my functions.php: ~remove_filter(‘the_content’, ‘wpautop’); This was in the WordPress underscore empty template which I started the project with, and was removing html from the content.

Add/remove tags on frontend programmatically

Found the solution in https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/taxonomy.php#L0 wp_add_object_terms() uses wp_cache_delete(), but wp_remove_object_terms() don’t. Just added this: wp_remove_object_terms( $post->ID, $tag_id, ‘post_tag’ ); wp_cache_delete( $object_id, ‘post_tag_relationships’ );

Separate the tag by comma [duplicate]

This is actually more php related. Best will be to add your term names in an array and then use implode to convert it to a comma separated string $my_tags = get_the_tags(); if ( $my_tags ) { foreach ( $my_tags as $tag ) { $tag_names[] = $tag->name; } echo implode( ‘, ‘, $tag_names ); }

Order post by taxonomy

It is quite easy to achieve this. Your answer is usort() FEW NOTES: Before we code, just a few notes Requires PHP5.4+ due to the use of the short array syntax ([]). If you have an older version, you should really upgrade as older versions are a real security threat as all older versions prior … Read more

Remove ‘style=’ from Tag Cloud

wp_generate_tag_cloud has a filter that allows you to edit the string input. You can use regex to find and remove the inline style: add_filter(‘wp_generate_tag_cloud’, ‘na_tag_cloud’,10,1); function na_tag_cloud($string){ return preg_replace(“/style=”font-size:.+pt;”https://wordpress.stackexchange.com/”, ”, $string); }

WordPress title as keywords (tags) with excluded stop words

Here is your updated function solving your 2 problems : // Post title as keywords, excluded stop words function title_as_keywords( $word ) { $blacklist = array(‘this’, ‘about’, ‘that’, ‘them’); // Excluded words … $whitelist = array(‘one’, ‘man’, ‘boy’/*etc..*/); // Whitelisted words … if ( (!in_array( $word, $blacklist ) && strlen( $word ) > 3 ) … Read more

Adding Related Articles to post

1) It’s tag__in (two underscores) 2) get_the_tags() returns an array of objects, you need IDs: if ( $the_tags = get_the_tags() ) { // https://developer.wordpress.org/reference/functions/wp_list_pluck/ $the_tags = wp_list_pluck( $the_tags, ‘term_id’ ); } $rel_pst = get_posts( array( ‘tag__in’ => $the_tags, ‘exclude’ => $post->ID, ‘post_per_page’ => 4, ‘ignore_sticky_posts’ => true, ‘post_type’ => array( ‘ms’, ‘gnd’, ‘events’, ‘news_article’, ‘opinions’, … Read more

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