Return to Support

Show Tag Cloud as unordered list

Home Forums Graphene WordPress theme Support Show Tag Cloud as unordered list

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2942
    Anonymous

    I know this one is weird as the purpose of the tag cloud is to differentiate the tags based on size which is based on usage BUT when the site is just starting all of the tags are the same size and they are just an ugly list of words.

    Can I set a parameter that returns an unordered or ordered list instead of the present format? I see in the codex that there is a parameter of ‘format’ with an option of ‘list’ but I haven’t found where that might be modified within Graphene.

    As always thanks for your help.

    #22786
    Prasanna SP
    Member

    Just use the same font for both smallest and largest fonts. Here is an example. This should go in child theme’s functions.php file. (Untested, but should work.)

    function samefont_tag_cloud($args) {
    $args['largest'] = 12; //largest tag font size
    $args['smallest'] = 12; //smallest tag font size
    return $args;
    }
    add_filter( 'widget_tag_cloud_args', 'samefont_tag_cloud' );

    This will return a flat tag could with all the tags of the same font size. If you want unordered list, add $args['format'] = 'list'; to the args

    function samefont_ul_tag_cloud($args) {
    $args['largest'] = 12; //largest tag font size
    $args['smallest'] = 12; //smallest tag font size
    $args['format'] = 'list'; //unordered list
    return $args;
    }
    add_filter( 'widget_tag_cloud_args', 'samefont_ul_tag_cloud' );

    #22787
    Craig
    Member

    Thanks Prasanna. Actually I have been a bad boy and making changes through the custom css so when you wanted to add to functions.php I bit the bullet and created a child-theme (I’ve matured to that point with six Graphene installations so I should do it the right way.)

    At any rate I’ve created child theme, activated it, added functions.php and added your code (with the prerequisite <?php and ?>) but it doesn’t seem to create the UL. Any ideas? You can see the page at http://www.tracydunndesign.com/tracys-blog/. Thanks.

    #22788
    Prasanna SP
    Member

    Did you try the second code I’ve given here?

    i.e adding $args['format'] = 'list';

    Current font sizes but, unordered list,

    function samefont_ul_tag_cloud($args) {
    $args['format'] = 'list'; //unordered list
    return $args;
    }
    add_filter( 'widget_tag_cloud_args', 'samefont_ul_tag_cloud' );

    All tags of same font size and unordered list,

    function samefont_ul_tag_cloud($args) {
    $args['largest'] = 12; //largest tag font size
    $args['smallest'] = 12; //smallest tag font size
    $args['format'] = 'list'; //unordered list
    return $args;
    }
    add_filter( 'widget_tag_cloud_args', 'samefont_ul_tag_cloud' );

    #22789
    Craig
    Member

    Yes. It was your second batch of code that I put in functions.php. Since this is the first time I’ve created functions.php let me include the code so you can see. Maybe some structure is incorrect. Thanks.

    <?php
    function samefont_ul_tag_cloud($args) {
    $args['largest'] = 12; //largest tag font size
    $args['smallest'] = 12; //smallest tag font size
    $args['format'] = 'list'; //unordered list
    return $args;
    }
    add_filter( 'widget_tag_cloud_args', 'samefont_ul_tag_cloud' );

    ?>

    #22790
    Prasanna SP
    Member

    Hmmm.. Are you using any caching plugin?

    I can fix it for you if you give me the temporary access to your admin area.

    Else, I can write a plugin for that. But, it takes some time.. I’m busy now..

    #22791
    Craig
    Member

    I have no problem granting you access. How should we do it? I’m craig@kamamarketing.com

    #22792
    Prasanna SP
    Member

    Use my contact form to send me the login credentials – http://www.prasannasp.net/contact/

    It’s too late here. I’m gonna sleep now. So, I’ll look at your site tomorrow.

    #22793
    Prasanna SP
    Member

    Wow! There is already a plugin called “Configurable Tag Cloud (CTC)”. Try it – http://wordpress.org/extend/plugins/configurable-tag-cloud-widget/

    It has an option to set format as “list”

    http://wordpress.org/extend/plugins/configurable-tag-cloud-widget/

    #22794
    Craig
    Member

    I’ve loaded it but it isn’t working so I’m taking a look at some of the code and install and see. If your php code didn’t work and his plugin didn’t work then the problem sort of points to me. I’ll look and if I can’t get it to work I’ll send you the login info.

    FYI while I’m trying to get the plugin working I’ve taken down the function.php file to make sure they weren’t in conflict of each other. I’ll check in again.

    #22795
    Craig
    Member

    Couldn’t get plugin to work. There is a two month old post with no reply in the forum that says there is an issue with WordPress 3.2.1 which I’m running on this site. I don’t want to update to 3.3.1 because I need to document my changes before I update. (Had to change some files to get the embedded font to work.)

    I’ve put the functions.php file back on the server. The configurable tag cloud plugin is still activated if you want to play with that.

    Thanks for your help. Craig

    #22796
    Prasanna SP
    Member

    Ah! Weird! The above code is working in my site, but not in yours’! I even tried adding a php widget with this code, (which is supposed to work, of course! 🙂

    <?php if ( function_exists('wp_tag_cloud') ) : ?>
    <li>
    <ul>
    <?php wp_tag_cloud('format=list&smallest=12&largest=12'); ?>
    </ul>
    </li>
    <?php endif; ?>

    But the widget itself is invisible on the site! So I suspect the issue is with the WordPress version. Let me know once you update the WordPress. I’ll check it again.

    BTW, a blank functions.php file is okay in the child theme. No need to delete it from the server.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.