Shape 5

Wordpress Club Themes => BlogBox - Club => : dache74 October 12, 2016, 05:34:14 PM



: Widget heading being filtered out
: dache74 October 12, 2016, 05:34:14 PM
Hi, I've deployed a widget to display recent articles from a category, but the template keeps filtering out the widget title. I set the widget title to Recent News, but the title gets rendered as commented out:
:
<!--<span class=&quot;s5_h3_first&quot;>Recent</span> <span class=&quot;s5_h3_last&quot;>News</span>-->

Does not matter which widget style I pick, the title does not show up. How do I enable displaying the title?
Here is the page: http://www.hackerdad.co/. The widget is at the top of the left column.

Thanks!


: Re: Widget heading being filtered out
: Tristan Rineer October 13, 2016, 10:59:45 AM
Is that a widget from WP, or a third party plugin?  I may have an idea as to why it's acting that way, but narrowing down the source of the widget may help in the troubleshooting.

You can also try using the troubleshooting method that I have in the code of theme-globals.php.  Just look for the "Classfix for Widget Styles" section.


: Re: Widget heading being filtered out
: dache74 October 13, 2016, 12:46:36 PM
It's 3rd party -- Category Posts (https://wordpress.org/plugins/category-posts/). I tried changing the clearfix setting to true, but it did not help. 


: Re: Widget heading being filtered out
: Tristan Rineer October 14, 2016, 07:30:27 AM
You should be able to find the following code in theme-globals.php:

:
/** Classfix for Widget Styles **/

//"true" to show before/after for each widget - after needs to match the wp-options field that widget settings are stored in.
$s5_wid_styles['classfix']['show'] = false;
//To fix a mis-named widget "class", add a line in the format of:  'before' => 'after',
//Include the single quotes & comma, as seen below.
$s5_wid_styles['classfix']['names'] = array(
'recent_entries' => 'recent-posts',
'recent_comments' => 'recent-comments',
'archive' => 'archives',
'advanced_recent_posts_widget' => 'widget_advanced-recent-posts',
'rpjc_widget_cat_recent_posts' => 'widget_rpjc_widget_cat_recent_posts',
);


/** End Classfix for Widget Styles **/

If you set the Class Fix "show" variable to "true" then refresh your site, every widget should show a before/after status line.  For any widget where the before & after don't match, adding an item to the names array should fix the title detection.


: Re: Widget heading being filtered out
: dache74 October 14, 2016, 07:59:54 AM
It matches for this widget:

Before: cat-post-widget
After: cat-post-widget


: Re: Widget heading being filtered out
: Tristan Rineer October 17, 2016, 07:00:19 AM
If that is the case, then something in the way that plugin is coded is preventing the widget styling code from being able to detect if the widget has a title or not.

You can try changing the following code in theme-globals.php, but it may cause other widgets to show title code even when they don't one, or it might completely break the layout of your site:

Find:
:
	/* no_title */
$s5_wid_styles['no_title'] = $s5_wid_styles['clean'];
$s5_wid_styles['no_title']['before_title'] = '<!-- h3>';
$s5_wid_styles['no_title']['after_title'] = '</h3 -->';

Change it to:
:
	/* no_title */
$s5_wid_styles['no_title'] = $s5_wid_styles['clean'];
// $s5_wid_styles['no_title']['before_title'] = '<!-- h3>';
// $s5_wid_styles['no_title']['after_title'] = '</h3 -->';

That will prevent widgets without detected titles from commenting out the title section of the code.


Unfortunately, if that doesn't work, I'm not sure what else to tell you.  There's a lot of code that goes into making the framework so flexible, but that also means that (as per the Shape 5 Terms of Use (http://www.shape5.com/terms_of_use.html)), there can be no guarantee of compatibility with third-party plugins; but most plugins I've tried have worked fine - it's very rare to find one that has issues.