WordPress.org

Ready to get started?Download WordPress

Forums

Featured Page Widget
[resolved] Add a class to the widget on current page (2 posts)

  1. Intégrateur web
    Member
    Posted 10 months ago #

    Hi,

    Is it possible to add a CSS class to the widget if the current page is the same as that displayed on the widget?

    I use several widgets plugin on the same page, and I would add the CSS on the "current" widget.

    Is it possible ?

    Thanks in advance,
    Vivienb

    http://wordpress.org/plugins/featured-page-widget/

  2. Intégrateur web
    Member
    Posted 10 months ago #

    I use custom function so :)

    //allow html in widget title
    function lxb_change_widget_title($title)
    {
        //convert square brackets to angle brackets
        $title = str_replace('[', '<', $title);
        $title = str_replace(']', '>', $title);
    
        //strip tags other than the allowed set
        $title = strip_tags($title, '<a><blink><br><span>');
        return $title;
    }
    add_filter('widget_title', 'lxb_change_widget_title');

Reply

You must log in to post.

About this Plugin

About this Topic