For some reason my child theme templates are not being recognized.
I believe I have followed the correct procedure (and checked for caching etc)
/wp-content/themes/divi-child/includes/builder/module/Blog.php
should replace
/wp-content/themes/Divi/includes/builder/module/Blog.php
(same path and same file with a slight update)
The child theme module template is not recognized (changes to the child theme template have no effect)
I have tested editing the main file and this works immediately every
time.
Any advice greatly appreciated.
Cheers
EDIT
The below should work according to Divi however it breaks the site when I try.
Apparently it is not enough to just copy the module into the child theme. The file needs to be duplicated. Then copied file to child-theme/custom-modules/Blog.php. After adding following code to the bottom of the functions.php file:
function divi_custom_blog_module() {
get_template_part( '/custom-modules/Blog' );
$myblog = new custom_ET_Builder_Module_Blog();
remove_shortcode( 'et_pb_blog' );
add_shortcode( 'et_pb_blog', array( $myblog, '_render' ) );
}
add_action( 'et_builder_ready', 'divi_custom_blog_module' );
2
Answers
I have got this issue similar to this before. I think – maybe the blog template is called by another file in the "father theme" folder some thing like:
this will cause the issue. to fix this there are two way:
#1: find and edit the file wich is call the blog template (not recommend)
#2: find and copy the file wich is call the blog template to your child theme (you can try with index.php, content.php or single.php first) (recommend)
There are a few other steps https://intercom.help/elegantthemes/en/articles/4532734-moving-blog-module-in-child-theme
Create a new folder in the child theme folder, for example, includes folder.
Now copy the Divi/includes/builder/module/Blog.php file from the parent theme into the child-theme/includes/ folder.
Open up the Blog.php file of your child theme and replace this line (at the very top):
with:
Replace: $this->vb_support = ‘on’; with $this->vb_support = ‘off’;
Remove this line from the bottom: new ET_Builder_Module_Blog();