In the comments section of Featured image below header on static Pages in Infinity Pro, a user asked:
How can I add the title of the page to the middle of the image?
This tutorial provides the steps to
- register a custom image size for hero image on static Pages and single Posts.
- create a custom shortcode that outputs the URL of author page for the entry author outside the loop.
- create a WordPress template part having the code to (if a featured image is present) a) show featured image and entry header below site header b) remove all actions hooked to entry header (entry title, entry meta etc.) c) Replace Sridhar Katakam shortcode with our custom one from earlier step in the post info.
- load the above template part into the templates for static Pages and single Posts.
- add CSS to overlay the entry header centered on top of the featured image when the viewport width is more than 800px.
in Infinity Pro.
Sample screenshots:
Static Page having a featured image:
Single Post having a featured image:
Tested in Infinity Pro version 1.1.3.
Step 1
Add the following in Infinity Pro's functions.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.