WordPress.org

Ready to get started?Download WordPress

Forums

Custom Class on Text Widgets
Don't write title if it's empty (2 posts)

  1. shortster
    Member
    Posted 2 years ago #

    Thanks for this great (and tiny at the same time) plugin! Just what I needed.

    There is one thing I had to change though. I don't want the h4 elements to be written when the title is empty. So I added (line 24):

    if ($title != '') {
        echo    $before_title.$title.$after_title;
    }

    Would be nice if you could add it to the codebase.

    Cheers

    http://wordpress.org/extend/plugins/custom-class-text-widget/

  2. Zhuka
    Member
    Posted 1 year ago #

    And one more condition for widget without any class:
    22: echo (!empty($customClass)) ? '<div class="'.$customClass.'">'.PHP_EOL : '<div>'.PHP_EOL;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic