Plugin JetPack: what about with class Featured_Content from theme TwentyFourteen ?

Plugin JetPack has a strange behavior with class Featured_content of TwentyFourteen theme and child theme like here TwentyFourteen-xili!

Feedback after investigations

In TwentyFourteen, in sub-folder inc file featured-content.php contains class Featured_Content. It is possible to copy (and modify) inside child theme (as done in TwentyFourteen-xili to include sub-selection and cache according current language). As here in frontpage, only featured posts in a language are displayed. Because functions from functions.php are fired before those of parent theme: no problem, modified class has priority!

All is working well until JetPack will be installed… no sub-selection :-(
By tracing, the modified class is not used
In JetPack settings, no way to disable (not load) Featured_Content Class, only a class with same name loaded before is possible !
How to force to download the child theme Featured_Content Class ?

In sources below (theme-tools.php – extrait ci-dessous) : no filter, only test with class_exists

Only possible solution, creating a plugin with a filter before the time where JetPack load the modules (plugins_loaded – priority 100).

Remember it is impossible to add filters “plugins_loaded” inside functions.php of a theme. It is too late according timeline of wp_settings.

The code below show that featured-content.php file will be required before JetPack requires its modules:

This example code lines are easy to insert in a very simple plugin.
For multilingual context, these lines (with options) are now inside xili-language (v 2.11.1+). Here, you will see in real time that TwentyFourteen-xili multilingual recovers his behavior and sub-select featured posts in frontpage.


One thought on “Plugin JetPack: what about with class Featured_Content from theme TwentyFourteen ?”

  1. I tracked it down! The same problem exists with the plugin “Fourteen Extended” by Zulfikar Nore. I disabled it and implemented your solution with Jetpack. That worked perfectly. However, your solution does NOT work with Fourteen Extended. Thanks a lot! 😀 I’m happy it works now (even without Fourteen Extended!


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">