Home › Forums › Themes Support › mediPress – Health and Doctor Medical WordPress Theme › How to override shortcode template files in child theme
Tagged: childtheme
- This topic has 6 replies, 3 voices, and was last updated 5 years, 10 months ago by dan.stephens.
-
AuthorPosts
-
-
05/09/2018 at 1:21 AM #15283
How can I override files located in the parent theme’s “framework/shortcodes” folder? I’m trying to update the “doctor” shortcode with some custom fields and when I place the tpl1.php file in the same location in my childe theme, the parent theme file is not overwritten.
I’ve placed the updated version of “tpl1.php” file in this file path “/wp-content/themes/medipress-child/framework/shortcodes/doctor/tpl1.php”, however it is not updated on the site. (No cache involved)
Thanks!
-
05/09/2018 at 4:58 PM #15315
Hi,
Thanks for reaching us!
Could you please send us Admin login detail?
We will check and assist you to resolve this. -
05/09/2018 at 7:29 PM #15322This reply has been marked as private.
-
05/10/2018 at 8:25 AM #15331
Hi!
Shortcode doctor/tpl1.php using normal.
Link test: https://kaczmarski.staging.wpengine.com/demo_sc/
Images: http://prntscr.com/jfx14l
Please check again. -
05/10/2018 at 7:32 PM #15355
Hi Long,
It’s “normal” because I edited the tpl1.php file in the parent theme, which is NOT the correct way to do it. I want to OVERRIDE the tpl1.php file in the parent theme, by placing a modified version in the child theme. However when I do so, the file is not overridden and it still uses the parent theme file. Please check the site again to see what I mean. I’ve switched the parent theme file back to the default version and placed the override tpl1.php file in the childe theme under “/wp-content/themes/medipress-child/framework/shortcodes/doctor/tpl1.php”. This should override the parent theme file but it does not. Is there a way to make this override work? Thanks!-Dan
-
05/11/2018 at 1:53 PM #15370
Hi!
I have fixed for you.
http://prntscr.com/jgfncs
Please check again! -
05/11/2018 at 7:43 PM #15403
Great! Thank you! So to be clear for other users who might encounter this: the shortcode override actually was working but I had some CSS in the wrong place which was causing the overridden file to act funny.
-
-
AuthorPosts
You must be logged in to reply to this topic.