Archived topic
Using featured-images.php in child theme
5 replies · Started by Drew on August 25, 2022
I feel like this should be really easy, but I can't seem to figure it out: I want to change how featured images are handled by editing the template output, so I'm trying to copy inc/structure/featured-images.php into my child theme, but it doesn't seem to register there. My code changes work when I make them to the file in the parent/main GP theme, but not when I copy that file into the generatepress_child theme. I've tried putting it in the base child theme directory, in inc/structure and inc but none of that works. Thanks in advance for the support!
Hi there,
Can you tell us how would you like to change the featured image?
I'm trying to create a hero banner using the featured image, the page title, and an ACF field. I could assuredly do it through Elementor or a similar theme builder, but I'm trying to avoid it unless I absolutely need to.
The banner would look something like this, minus the button: http://rafaltomal.com/wp-content/uploads/2014/04/hero-9.jpg
You can achieve this using GP's block element along with GenerateBlocks plugin.
https://docs.generatepress.com/article/block-element-page-hero/
The video in the link demonstrate how to create the block element page hero.
Once the block element - page hero is created, you can use a header element to merge the header with content.
Here's an video demostration: https://youtu.be/TP8mgBQTgGg
Thanks for the tip. I was trying to avoid adding Yet Another Plugin when I knew I could just add a few lines of code to a theme template, but this works for now.
You are welcome :)
GenerateBlocks is very useful for GP users, as GP's block elements require GB to get the dynamic data.