I am using the llorix_one_lite theme, and I love it. It has an awesome front-page with different sections, which are included in a "sections" folder. For example: llorix_one_lite_contact_info_section.php.
I have added a simple text field to the theme customizer on a local site. It works perfectly.
I did this by first creating a child theme: Llorrix_one_lite_child. And then in a "sections" folder I have a file called: Llorix_one_lite_child_contact_info_section.php, which is identical to the parent file with the exception of the h2 tag i am editing through the customizer.
When I upload this to a live site, it does not work. The child file (llorix_one_lite_child_contact_info_section.php) is not overriding the parent counterpart (llorix_one_lite_contact_info_section.php).
I know the code in the functions.php is working, as it saves the setting in the customizer, but is not outputted (because the get_theme_mod is never called on said ).
Should I rename the child file to: llorix_one_lite_contact_info_section_child.php? --- Or: llorix_one_lite_contact_info_section.php?
I only tried the latter on my local machine, but it breaks the section. It shows up in the customizer, but changes nothing on the frontend.
Thank you for reading my long (and first post) here on the wordpress community. I am new at wordpress develeping, but hope to have a career in web development and/or front-end developing.
Thanks
Edit: As requested by WebElaine I included the files below.
First the child themes function.php
//add contact_info_heading in customizer
function wpl_customize_register( $wp_customize )
{
//sections, control, and settings go here
$wp_customize->add_setting( 'contact_heading_text' , array(
'default' => 'Giver Uforpligtende Tilbud',
'transport' => 'refresh',
'type' => 'theme_mod',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'contact_heading_text', array(
'label' => __( 'Contact Heading Text', 'wpl' ),
'section' => 'contact_heading_section',
'settings' => 'contact_heading_text',
'type' => 'text',
) ) );
$wp_customize->add_section( 'contact_heading_section' , array(
'title' => __( 'Kontakt overskrift', 'wpl' ),
'priority' => 60,
) );
}
add_action( 'customize_register', 'wpl_customize_register' );
Now the llorix_one_lite_child_contact_info_section.php (the h2 tag i am trying to alter. Tell me if you need the entire file. It is very long and mostly filled with HTML
<h2 class="tilbud-text"><?php echo get_theme_mod( 'contact_heading_text' );
And an image of the file structure of the theme abd child theme.
Both of these files are on my local machine, where everything works perfectly.
Now the corresponding files for the live server:
The functions.php is exactly the same (I just copy pasted it). as is the llorix_one_lite_child_contact_info_section.php.
To test what is happening, I wrote a comment in the parent on the live server:
llorix_one_lite_contact_info_section.php that tells me if it is the parent file that is being used.
I have a screenshot below where said comment is marked. The heading in the picture is the one I am trying to change:
I hope this clears it up.
EDIT:
To add to things I do not understand - I looked through my front-page.php (which succesfully overrides the parent one) both locally and on the live server.
It has this array that id uses to include the sections on the front page:
$sections_array = apply_filters(
'llorix_one_companion_sections_filter',
array(
'sections/llorix_one_lite_logos_section',
'sections/llorix_one_lite_our_story_section',
'sections/llorix_one_lite_content_section',
'sections/llorix_one_lite_ribbon_section',
'sections/llorix_one_lite_latest_news_section',
'sections/llorix_one_lite_child_contact_info_section',
'sections/llorix_one_lite_map_section',
)
);
if ( ! empty( $sections_array ) ) {
foreach ( $sections_array as $section ) {
llorix_one_lite_get_template_part( $section );
}
}
I tried changing the file name to match different ways. If my actual file name is: llorix_one_lite_child_contact_info_section, and the string reference is the same everthing works (locally). However, if I change the string reference (or delete the array entirely), everything still works... But if I change the actual file name to correct name (without the _child), and change the array to the same, it does not work. The file is not included on the frontpage.