WordPress.org

Ready to get started?Download WordPress

Forums

WordPress tagcloud arguments (3 posts)

  1. scheric1
    Member
    Posted 1 year ago #

    I am making some modifications to my tagcloud widget on my wordpress site. My goal is to generate a regular list of tags that have currently been used (most popular on top).

    I have added some entries to my functions page as follows:

    function custom_tag_cloud_widget($args) {
    $args['number'] = 0; //adding a 0 will display all tags
    $args['largest'] = 16; //largest tag
    $args['smallest'] = 16; //smallest tag
    $args['unit'] = 'px'; //tag font unit
    $args['format'] = 'list'; //ul with a class of wp-tag-cloud
    $args['orderby'] = 'count'; //change list order by popularity
    return $args;
    }
    add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );

    Everything is working except the orderby argument

    For whatever reason it acts like it's not there (the widget still loads my links in alphabetical order instead of by number of times tag has been used)

    Can someone help me as to why this isn't working?

    Thanks

  2. doingbusiness
    Member
    Posted 1 year ago #

    @scheric1, I can't but you may be able to answer my question. I want to edit the font size for my tags which will show up on my sideboard under my widgets.

    I went to my function page, I see the widget programming, look below - where do I put your entry to get same size fonts of my cloud tags? Help and thanks:)

    [ Code moderated. For more than 10 lines of code please use pastebin.com instead. ]

  3. scheric1
    Member
    Posted 1 year ago #

    simply paste that function under the other function already in your functions.php file

Topic Closed

This topic has been closed to new replies.

About this Topic