I found this solution to getting the featured image to default below the post title. wordpress add featured image below post title
Where do I place this php?
Will it work for all posts?
I found this solution to getting the featured image to default below the post title. wordpress add featured image below post title
Where do I place this php?
Will it work for all posts?
Please have a look at the wordpress template hierarchy in themes:
https://developer.wordpress.org/themes/basics/template-hierarchy/
You can edit the look of single post views inside the single.php
, if using a custom post type single-{post-type}.php
. If you are using a theme that is not made by yourself and might get updated, make sure to use a child theme, so your changes will not be overwritten when the parent theme is getting updated.
This is a nice tutorial for creating child themes in wordpress: https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/
In the template file you get the featured image with get_the_post_thumbnail()
function and the post title with get_the_title()
function.
Search for the lines in the code, where you can find the functions and change the location to your desired place. Or if there is no featured image, you can add the code you already found.
Inside of the single page template of your theme.
If you use the single.php
file, yes. All posts use this template. But you can only apply the changes to specific post types as described above - if you like to. You can also make it work for some specific category terms with category-{term}.php
or maybe you want to change the post listing in your archive.php
. Please check the link above, Wordpress Template Hierarchy will make this clear, very easy to understand.
Hope this helps!