Redux breaks in Child Theme
-
I have setup a child theme on top of a WordPress theme in order to modify the look and feel of my website.
The Child Theme works fine for simple enhancement like changing colors or so.
However, things don’t seems to work well when I start changing the template (e.g.., xxx.php in the /INCLUDE subfolders).I made changes to the template by copying the original file from the parent theme into the child theme (following exactly the same folder structure). I’m pretty sure the template in the child theme is triggered by simply did a echo ‘test’ in the child theme template.
But, other statements in the child theme template don’t work like they used to be.
I believe the parent theme is using Redux framework.
Example of section of the template (original code) not working in the child theme:
<?php $post_id = get_the_ID(); //image src $attachment_id = get_post_thumbnail_id( $post_id ); $image_attributes = wp_get_attachment_image_src( $attachment_id, 'large' ); $outputimagesrc = 'background:url('.$image_attributes[0].');'; //if price and currency are set if ($redux_demo['metabox_package_price'] == ''){ $outputpricecurrency = ''; }else{ $outputpricecurrency = '<a href="'.$permalink.'" class="gene_btn gene_bg_'.$redux_demo['metabox_package_color'].' left white medium">'.'From '.$redux_demo['metabox_package_price'].' '.$redux_demo['metabox_package_currency'].'</a>'; } echo ‘test’;
By the way, this is my functions.php in the Child Theme (for you to tell if I’ve missed anything to connect the child with the parent).
<?php add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); function enqueue_parent_theme_style() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); wp_enqueue_style( 'responsive', get_template_directory_uri() . '/css/gene_responsive.css' ); wp_enqueue_style( 'gene_elusive_icons', get_template_directory_uri() . '/framework/ReduxCore/assets/css/vendor/elusive-icons/elusive-icons.css' ); }
It seems the $redux_demo[‘metabox_package_price’] always returns null. This was not the case before I copied the template over to the child theme.
I have to say I’m new to Redux and WordPress. I think I’m missing some setup that connects the child theme to the parent theme in order to continue using the Redux framework setup for the parent theme?
Please advise.
- The topic ‘Redux breaks in Child Theme’ is closed to new replies.