Forum Replies Created
-
AuthorPosts
-
darkpolloMember
That is what I am using. I needed to code to use the template.
Thanks
darkpolloMemberChild themes are updated if you are using anyone of the studiopress themes...
Thanks for the link! I think I will be able to finish it with that info.
Have a nice day!
darkpolloMemberHi,
Thanks, but that explains how to create a page template.
I have it already, I want to add it to the theme without modifying the actual child theme I have, so I do not loose it when I update the theme in the future.I am working with this:
https://codex.wordpress.org/Function_Reference/load_templateBut I am not sure which hook use to call that function.
March 17, 2014 at 1:57 pm in reply to: Customize genesis_get_image_id() function on child theme #95373darkpolloMemberI want to replace the actual genesis_get_image function code and use a new function of my own.
Normally, when you replace a function using a child theme, the one on the main theme does not load, but here on genesis it loads first the main theme. I think this is a problem that needs to be fixed on the main code.
From the wordpress guide:
https://codex.wordpress.org/Child_Themes
Using functions.php
Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)In that way, the functions.php of a child theme provides a smart, trouble-free method of modifying the functionality of a parent theme. Say that you want to add a PHP function to your theme. The fastest way would be to open its functions.php file and put the function there. But that’s not smart: The next time your theme is updated, your function will disappear. But there is an alternative way which is the smart way: you can create a child theme, add a functions.php file in it, and add your function to that file. The function will do the exact same job from there too, with the advantage that it will not be affected by future updates of the parent theme. Do not copy the full content of functions.php of the parent theme into functions.php in the child theme.
TIP FOR THEME DEVELOPERS. The fact that a child theme’s functions.php is loaded first means that you can make the user functions of your theme pluggable —that is, replaceable by a child theme— by declaring them conditionally. E.g.:
if ( ! function_exists( 'theme_special_nav' ) ) { function theme_special_nav() { // Do something. } }
In that way, a child theme can replace a PHP function of the parent by simply declaring it beforehand.
darkpolloMemberThank you!
I will try this on my theme and see how it works. -
AuthorPosts