How to display tag cloud without links

We can modify the output with the filters wp_tag_cloud or wp_generate_tag_cloud. But we could also use: echo strip_tags( wp_tag_cloud( ‘echo=0&smallest=10&largest=10&number=0&format=list’ ), ‘<ul><li>’ ); where we strip all the HTML tags from the output, except the ul and li tags. Notice that we added the echo=0 parameter as mentioned in the Codex as a way to … Read more

Show post tags on attachment page?

This should work to get the parent’s tags. <?php global $wp_query; $attachment_id = $wp_query->post->ID; $parent_id = get_post_field(‘post_parent’, $attachment_id); $parent_tags = wp_get_post_tags($parent_id); $tag_count = count($parent_tags); // Counting the tags to find know the last one so there is no pipe $i = 1; // Setting up the count if ($parent_tags) { ?> <div> Tagged with:<br /> … Read more

Remove URL from Tag

get_the_tags codex page says The following example displays the tag name of each tag assigned to the post (this is like using the_tags(), but without linking each tag to the tag view, and using spaces instead of commas): <?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ‘ ‘; } … Read more

How to get popular post tags

It is the max and min font size for most popular and least popular tags. If you are just want to display the popular tags and not the cloud then you can use the format option to display as an unordered list.

Get all terms if product of that term contains a specific category

I needed something similar. This is what I did: $args = array( ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => get_query_var(‘taxonomy’), ‘field’ => ‘slug’, ‘terms’ => get_query_var(‘term’), ) ), ); $products = new WP_Query($args); $attributes = array(); while ($products->have_posts()) : $products->the_post(); $post_atts = get_the_terms(get_the_ID(), ‘pa_’ . $attr); if ($post_atts) { foreach ($post_atts as $x) … Read more

How to add prefix or suffix to post_tag slug?

We can do this by following code: function custom_tag_rewrite() { add_rewrite_rule(“^tag/(.+)-suffix/?$”, ‘index.php?post_type=post&tag=$matches[1]’, ‘top’); flush_rewrite_rules(); } add_action(‘init’, ‘custom_tag_rewrite’); and try open like this http://example.com/tag/post-tag-slug-suffix

Why word can’t be displayed in wordpress?

These tags will be stripped by WordPress, as if you are inserting a code directly to your post’s content. To add special characters to your post, switch to visual editor, and then click the special character button as shown below: Now you can select any character you want from the list. You can also do … Read more

Return post tags with description

This is how you can loop with custom taxonomy. function returnpost_tags(){ // get tags by post ID $post_ID = get_the_ID(); // here, you can add any custom tag $terms = get_the_terms( $post_ID , ‘post_tag’ ); echo ‘<ul>’; foreach ( $terms as $term ) { // The $term is an object, so we don’t need to … Read more

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