• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

How To Add Featured Image Before 1st H2 Tag 2 Ways In Any WordPress Theme

The code snippets inside this download folder enable you to add your featured image on single posts before the 1st H2 Tag or any other HTML tag. This means you can insert your image after any number of paragraphs but before the 1st heading tag like this :

Note : Modify the h2 tags in the PHP code to add your featured image before any type of HTML tags.

Demo Video

Shows the featured image inserted before the first H2 tag on single posts.

Tested using the Twenty Twenty One default theme for WordPress however will work in any WordPress theme.

Installation Steps

There’s 2 steps :

  1. # Copy & paste one of the the PHP code ( without the opening PHP tag ) snippets to the end of your child themes functions.php file.
  2.  

  3. # Upload the content-single.php template to your child themes template-parts > content folder so the template overrides your parent theme file but your code is not lost when your update your parent theme.
  4.  

Download Folder

Related Tutorials

  • How To Insert Featured Image Before 1st H2 Tag
  • Add Featured Image After 1st H2 Heading Tag in Single Posts

Featured Image Twenty Twenty One

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.