Viewing 8 replies - 1 through 8 (of 8 total)
  • It would be great to know this too. It’s a nice theme but it would be great to be able to use the tags. Any clues? Thanks.

    I have the same question. A short example would be great! Thanx

    +1

    Just go to Appearance -> Widgets, drag-and-drop Tag Cloud from Available widgets to Sidebar and that’s it.

    http://codex.wordpress.org/Appearance_Widgets_Screen

    Or am I missing something here?

    Thanks AO, I, and I’m sure others, have tried that but the tag cloud widget comes up empty. This, I believe, is because we are using tags in portfolio items, not ordinary posts or pages.

    When creating or editing a portfolio item a tag cloud of portfolio item tags can be viewed in the tag area of the edit page, so the information is available, just not in a widget as far as I can see.

    I’m guessing the query that returns tags from posts needs to be expanded to include portfolios in portfolio-enabled themes/plugins.

    Oh, I see. You guys are using custom post types plugin for this theme.

    Here’s a quick and dirty tag cloud widget, add the following to the functions.php (afterwords drag-and-drop new ‘Portfolio Tag Cloud’ widget as explained above):

    function portfolio_tags_widget_display($args) {
        extract($args);
        echo $before_widget;
        echo $before_title . __('Tags') . $after_title;
        wp_tag_cloud('taxonomy=portfolio_tag');
        echo $after_widget;
    }
    
    wp_register_sidebar_widget(
        'portfolio_tag_cloud',
        'Portfolio Tag Cloud',
        'portfolio_tags_widget_display',
        array('description' => 'Your most used portfolio tags in cloud format')
    );

    It’s also possible to add post tags to the cloud. Change wp_tag_cloud line above with this one:

    wp_tag_cloud(array('taxonomy' => array('portfolio_tag','post_tag')));

    Take a look here if you need to add more parameters:
    http://codex.wordpress.org/Function_Reference/wp_tag_cloud

    Phaethon2011

    (@phaethon2011)

    Thanks for the fix Andrei it worked (eventually).

    I’m not sure what I did first time around, but when I pasted your code into (a) functions.php it broke the entire site – couldn’t figure out what was wrong so I put the tag-cloud problem aside while I tweaked some other features and built content – hence the delay.

    When I returned to the tag-cloud issue I did what I thought I’d done before, but this time it worked a treat. Not sure what I screwed-up the first time but I pasted your code just after the function portfoliopress_update_portfolio_tags in the file:

    …\wp-content\themes\devinsays-portfolio-press-6c36bc8\functions.php

    (that, AFAICT, is the latest version of the theme from the author’s GitHub distribution)

    Anyway Andrei, thanks again for the tip.

    Phaethon2011

    (@phaethon2011)

    Duplicate Post

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Theme: Portfolio Press] Tags cloud in sidebar’ is closed to new replies.