Skip to content

Instantly share code, notes, and snippets.

@azizozbek
Last active September 13, 2023 20:18
Show Gist options
  • Save azizozbek/dc1839531342843445ca83114c814cd8 to your computer and use it in GitHub Desktop.
Save azizozbek/dc1839531342843445ca83114c814cd8 to your computer and use it in GitHub Desktop.
Get wordpress Tag Cloud by Shortcode
<?php
function get_tag_cloud() {
$args = array(
'smallest' => 15,
'largest' => 15,
'unit' => 'px',
'number' => 15,
'format' => 'flat',
'separator' => "\n #",
'orderby' => 'count',
'order' => 'DESC',
'exclude' => null,
'include' => null,
'link' => 'view',
'taxonomy' => 'post_tag',
'echo' => false
);
return wp_tag_cloud($args);
}
add_shortcode('grab_popular_tags', 'get_tag_cloud');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment