Last active
September 13, 2023 20:18
-
-
Save azizozbek/dc1839531342843445ca83114c814cd8 to your computer and use it in GitHub Desktop.
Get wordpress Tag Cloud by Shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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