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

  1. shortster
    Posted 4 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.



  2. Zhuka
    Posted 3 years 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

  • Custom Class on Text Widgets
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic