-
Author
-
December 10, 2015 at 22:41 #92513bkozlowskiParticipant
I would like to add another theme option to my pages/posts similar to the “Socket”. I’ve tested all the code within the parent theme and everything works great, but once I move the changes to my child theme i’m receiving the following error from functions.php.
Fatal error: Call to undefined function sq_option() in C:\xampp\htdocs\…\wp-content\themes\kleo-child\functions.php on line 691
What I’ve done:
1) Created a file and folder in my child theme “lib/metaboxes.php” and added the following code:
`array(
‘name’ => ‘Hide CTA area’,
‘desc’ => ‘Check to hide the CTA section.’,
‘id’ => $prefix . ‘hide_cta’,
‘type’ => ‘checkbox’,
‘value’ => ‘1’
),`
2) Copied the kleo_prepare_layout() function to my child them functions file and added the following code:
`if (get_cfield(‘hide_cta’) && get_cfield(‘hide_cta’) == 1 ) {
remove_action(‘kleo_after_main’, ‘kleo_show_cta’);
}`
3) Added the function below to my child theme functions file.
`function kleo_show_cta()
{
get_template_part(‘page-parts/cta’);
}
if (sq_option(‘socket_enable’, 1) == 1) {
add_action(‘kleo_after_main’, ‘kleo_show_cta’);
}`
This appears to be the culprit as this section of code was from theme-functions.php. How do I add this to my functions file? Also, should I be creating a “lib” folder or adding this somehow to my child them functions file?
Thanks!
December 11, 2015 at 20:17 #92728LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! 🙂Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
December 17, 2015 at 19:59 #93937RaduModeratorHi,
The lib folder from child will not overwrite the parent theme, in child you can overwrite only templates parts / page templates / buddypress but not lib or kleo_framework, in this case you should make the modifications to parent theme but on theme update your modifications will gone, you should make a backup of that files.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.