Community Forums › Forums › Archived Forums › Design Tips and Tricks › Featured Image Above Title…
Tagged: featured image, image above title, post title
- This topic has 4 replies, 3 voices, and was last updated 9 years, 11 months ago by Brad Dalton.
-
AuthorPosts
-
April 17, 2014 at 8:18 am #100952KellyBritoMember
Hi guys,
I'm using the Genesis Sample and I want to have the Feature image display above title. I was able to achieve this on Single pages with this tutorial. But it has no affect on the main blog/feed page. I, obviously, suck at php and would love some help to modify/adapt this piece of code so that I can have the featured image on single posts and main feed pages.
//* Add new image size
add_image_size( 'singular', 680, 200, TRUE );add_action ( 'genesis_entry_header', 'sk_featured_image_title_singular', 9 );
function sk_featured_image_title_singular() {if ( !is_singular() || !has_post_thumbnail() )
return;echo '<div class="singular-thumbnail">';
genesis_image( array( 'size' => 'singular' ) );
echo '</div>';}
April 17, 2014 at 8:51 am #100960Lauren @ OnceCoupledMemberIt's just a couple lines of code; can be found here: http://www.wpstuffs.com/how-to-switch-featured-image-above-the-title-in-genesis-framework/
Best,
Lauren
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
April 17, 2014 at 9:02 am #100966KellyBritoMemberThanks, Lauren! 🙂
Unfortunately, it didn't work. I also tried adding a featured image (according to Studio Press' code: http://my.studiopress.com/snippets/images/#add-featured) -but didn't work either.
The only code that worked was the one bellow. So my best bed would be modifying or replicating it for the blog/feed page -exchanging "singular" for the main feed page code instead. Any idea what code would be? I tried 'home-top' but didn't work.
//* Add new image size
add_image_size( 'singular', 680, 200, TRUE );add_action ( 'genesis_entry_header', 'sk_featured_image_title_singular' );
function sk_featured_image_title_singular() {
if ( !is_singular() || !has_post_thumbnail() )
return;echo '<div class="singular-thumbnail">';
genesis_image( array( 'size' => 'singular' ) );echo '</div>';
}
April 17, 2014 at 9:48 am #100983Brad DaltonParticipant1. You will need to reposition the featured image before the entry title on your blog page using different code.
This code works site wide so you'll need to add it to a custom function with conditional tag if your only want it to effect the home page.
http://wpsites.net/web-design/move-featured-image-before-entry-title-on-archive-pages/
2. This code adds the featured image on single posts before the entry title with the aligncenter class which you can change in the code.
Note: The code only works on themes running HTML 5 and needs to be copied from the view raw link.
April 17, 2014 at 12:52 pm #101007Brad DaltonParticipantHere's another couple of options depending on exactly what you want. http://wpsites.net/web-design/2-ways-to-reposition-your-featured-image-before-entry-title-on-home-page/
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.