Support » Fixing WordPress » Change title attribute in tagcloud links

Viewing 3 replies - 1 through 3 (of 3 total)
  • The example for functions.php that customising TC widget

    // prepare a topic count text
    function my_default_topic_count_text( $count ) {
        return sprintf( _n('%s article', '%s articles', $count), number_format_i18n( $count ) );
    }
    // customise the tag cloud widget
    function my_tag_cloud_args($in){
        return 'topic_count_text_callback=my_default_topic_count_text';
    }
    add_filter('widget_tag_cloud_args', 'my_tag_cloud_args' );

    you can edit other parameters of the tag cloud widget according to codex. e.g.
    'smallest=8&largest=20&number=35&topic_count_text_callback=my_default_topic_count_text';

    for customising hardcoded wp_tag_cloud you need only to call your custom function for topic_count_text_callback in arguments. (do not use filter for widget_tag_cloud_args)

    Thank you so much, Vjpo.

    I’m trying to understand and doing tests in my site with your code solution, but I don’t have enough php skills (I’m designer) to understand you or the Codex solution 🙁

    I’ve added the first code block to my functions.php but I don’t know how use these parameters to customize the title.

    Can you or anyone reading us be more specific? Thank you already for helping, Vjpo! : )

    Hi Hans! If you will clarify what text must be instead “x topics” and what kind of tag cloud do you use (default Tag Cloud widget or function wp_tag_cloud in theme code), I perhaps will be able to modify this function.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change title attribute in tagcloud links’ is closed to new replies.