Extended child theme functionality & Sticky header fix
-
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_oncerequire_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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Extended child theme functionality & Sticky header fix’ is closed to new replies.