No "Featured Content" in Customize or Reading
-
I downloaded the Superhero theme and used it on my private-hosted website, but couldn’t let the slider appear. In
readme.txt
:Special Instructions
—————To take advantage of the full-bleed featured post slider (requires WordPress.com Featured Content):
1. Create a post with a featured image that’s at least 960px wide.
2. Give the post the tag you declared under ‘Settings’ > ‘Reading’ > ‘Featured Content’.The problem is, I can’t find ‘Featured Content’ either under ‘Reading’ or ‘Customize’.
Then I checked the codes, and found out the
slider.php
called the functionsuperhero_get_featured_posts()
, which was defined injetpack.php
andjetpack.compat.php
:function superhero_get_featured_posts() { return apply_filters( 'superhero_get_featured_posts', false ); }
It seems that no hook called
superhero_get_featured_posts
had ever been added, so it would obviously return nothing.I solved this problem by adding the following codes in
functions.php
:/** * Add a filter function which fetchs posts through a specific tag name to the hook 'superhero_get_featured_posts'. It intends to fix the bug of downloaded Superhero theme. */ function get_slider_posts() { $tag = 'slider'; $args = array( 'taxonomy' => $tag, 'terms' => $tag, ); $postslist = get_posts( $args ); return $postslist; } add_filter('superhero_get_featured_posts', 'get_slider_posts');
Then I added a tag called
slider
to the posts with featured image, the slider then showed up. But anyway it’s not so elegant, and I’m sure there are some bugs in Superhero 1.1.1, because everything works fine on wordpress.com.
- The topic ‘No "Featured Content" in Customize or Reading’ is closed to new replies.