• Hello!

    I made some minor changes to the parent theme in order to extended my child theme options & functionality:

    inc/template-tags.php:1521
    Enclose onepress_load_hero_section() function with function_exists()

    
    if ( ! function_exists('onepress_load_hero_section') ) {
    		function onepress_load_hero_section() { [...] }
    	}
    }
    

    In order to add function onepress_load_hero_section(){ return true;} to avoid the double hero section issue.

    inc/customizer.php:18
    Change require to require_once

    
    require_once get_template_directory() . '/inc/customizer-controls.php';
    

    In order to add a text-field to a custom section-parts/section-hero.php

    
    	// Video
    	$wp_customize->add_setting( 'onepress_hcl1_video',
    		array(
    			'sanitize_callback' => 'onepress_sanitize_text',
    			'default'           => esc_html__( 'https://youtube.com/watch?v=id_video', 'onepress' ),
    		)
    	);
    	$wp_customize->add_control( 'onepress_hcl1_video',
    		array(
    			'label' 		=> esc_html__('Video', 'onepress'),
    			'section' 		=> 'onepress_hero_content_layout1',
    			'description'   => esc_html__('Video URL', 'onepress'),
    		)
    	);
    

    Also, I found that the sticky header will not work until you modify the file assets/js/theme.js:210 changing top to scrollTop:

    
    $thisSticky.css("top", scrollTop );
    

    Greeting & great theme!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author FameThemes

    (@famethemes)

    Hi @comecaramelos,

    Please update the latest OnePress theme and OnePress PLUS plugin then check again.

    Don’t need to edit anything in theme source code.

    Let me know!

    Thread Starter comecaramelos

    (@comecaramelos)

    Greetings!

    I have the latest OnePress theme and WordPress versions, but I’m not able to update the plugin [license expired :'(]

    Maybe the double hero section issue was solved, but the change in inc/customizer.php:18 file (require to require_once) would help to child themes.

    I.E.
    I’ve added a custom hero section to display the video popup using fancybox and also added a text field to fill with the video url at Hero customizr section.
    In order to do this at my child theme I need to import customizer-controls.php file content, but returns an error when loading parent theme file because it require the inc/customizer.php file again.

    Thanks 4 your answer!

    Theme Author FameThemes

    (@famethemes)

    @comecaramelos:

    You can’t overwrite these files in the child theme. Please read more here:

    https://developer.www.ads-software.com/themes/customize-api/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Extended child theme functionality & Sticky header fix’ is closed to new replies.