Minutes ago, Featured Articles PRO 2.4.7 was released. It comes with a few bugs solved (many thanks to our users for announcing us and allowing us to solve them on their test servers) and also, an enhancement in slideshow themes to allow hiding of different content in slides, namely title, date, description and read more link.
Featured Articles PRO 2.4.7 changelog
- Solved compatibility with Ether Content Builder for WordPress. Errors were caused by the way the widget in Featured Articles PRO was creating the select box for slideshows.
- Solved bug on slideshow creation/editing page that was preventing the page to redirect when saving on some installation. Problem was caused by a field name that WordPress uses in admin header file.
- Solved compatibility with Open Menu plugin for WordPress that was preventing Featured Articles to create custom slides.
- Solved problem with theme color scheme editor that was not saving the stylesheets correctly.
- New functionality that allows hiding of various information in slideshows is available. When editing a slideshow, new options for hiding title, text, date and read more link are available under Slide Content Options. Custom created themes will need to be slightly edited in order to have this functionality, please see below.
Making custom created themes compatible with Featured Articles PRO 2.4.7
If you created a custom theme for Featured Articles and want to enable in it the functionality that allows you to hide slide text, description, read-more link or date, there are a few things that you need to change since we created 2 more slideshow template functions that allow this functionality. All changes are to be made in file display.php of your custom theme.
First thing, the code for displaying the date. In previous versions, to display the date into a slide, the code looked like this:
[html]<span class="FA_date"><?php the_time(get_option(‘date_format’)); ?></span>[/html]
To avoid placing if conditions, we created a simple template function that does the exact same thing like the above piece of code but it also checks if user had set the date to be displayed into slides and if not, it won’t output anything.
[php]<?php the_fa_date(‘<span class="FA_date">’, ‘</span>’);?>[/php]
Next change applies only for some themes. For example, in theme Smoke, the title, date, read-more link and text are wrapped inside a div element that has a semi-transparent background (previous code below).
[html]
<div class="FA_wrap">
<?php the_fa_title(‘<h2>’, ‘</h2>’);?>
<span class="FA_date"><?php the_time(get_option(‘date_format’));?></span>
<?php the_fa_content(‘<div class="fa_content">’, ‘</div>’);?>
<?php the_fa_read_more();?>
</div>
[/html]
If the user hides from administration area all the items that are displayed into a slide (if for example he wants to have a slideshow that relies on images only), the slideshow will display an empty div element on the left having no content.
To avoid that, we created function fa_content_wrapper() that will verify if all elements are set as hidden and if true, it won’t output the HTML for the panel. In your templates, if the above applies (meaning you use a container for all slideshow content) you’ll have to use the function twice: once for the opening tag of the element that wraps all content and once for closing it.
[php]
<?php fa_content_wrapper(‘<div class="FA_wrap">’); // open the tag for the element that wraps all content
<?php the_fa_title(‘<h2>’, ‘</h2>’); // display the slide title
<?php the_fa_date(‘<span class="FA_date">’, ‘</span>’); // display the slide date
<?php the_fa_content(‘<div class="fa_content">’, ‘</div>’); // display the slide text
<?php the_fa_read_more(); // display the read-more link
<?php fa_content_wrapper(‘</div>’); // close the tag of the element that wraps all content
[/php]
These are all the changes that need to be done. Again, the second modification doesn’t apply to all themes, for example, theme Classic doesn’t need it because it doesn’t wrap all the content into a single element.
Please note that the modifications above are not mandatory, if you don’t distribute your custom theme and don’t need the functionality for hiding content in slides, you can just leave it alone. For the moment, the changes apply only for PRO version, update for Lite will be released in a few days.