• Resolved oksanaromaniv

    (@oksanaromaniv)


    Hello,

    I want to use icon shortcode in widget title. My code:

    add_filter(‘widget_title’, ‘do_shortcode’);

    //Creates a shortcode that displays a ship icon
    add_shortcode(‘icon-ship’, ‘cruise_shortcode_iconship’);

    function cruise_shortcode_iconship( $attr ){
    $output = ‘‘;
    return $output;
    }

    This code works for every widget but doesn’t work for Same Category Post. Can you suggest what should I do?

    Thank you,
    Oksana

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Daniel Floeter

    (@kometschuh)

    Hello Oksana,

    I implement the filter 'widget_title' and the code is available on GitHub.
    Can you get me your feedback, if this filter works for you?
    After your short feedback I will release a new version on www.ads-software.com for automatical download/update.

    Are you familair with GitHub? Because you can download the code there (https://github.com/DanielFloeter/same-category-posts) and copy it to your plugin folder ([your-wp-installation]/wp-content/plugins/same-category-posts) to your wordpress installation.

    My working example:

    function cruise_shortcode_iconship( $html ) {
    	return "prefix-" . $html . "-suffix";
    }
    add_filter( 'widget_title', 'cruise_shortcode_iconship' );
    Thread Starter oksanaromaniv

    (@oksanaromaniv)

    Hello Daniel,

    Thank you for implementing this feature. I downloaded new code from GitHub and everything worked!

    Many thanks,
    Oksana

    Plugin Author Daniel Floeter

    (@kometschuh)

    Hello Oksana,

    if you want to say thanks you can rate the widget with a 5-stare rating: https://www.ads-software.com/support/plugin/same-category-posts/reviews/?filter=5

    That would be also great. Thanks.

    Daniel

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘shortcode in widget title’ is closed to new replies.