How to use Child Theme for PHP code?
-
Hi Support,
I have been googling anywhere and still can’t find a solution.
I would like to use a child theme for my WordPress and still not working.
It’s not about css file but about PHP code. I have copied the file and folder exactly same to child theme and edit it but it doesn’t work.
WP still uses setting from the original theme.
The theme I use is estore from elegantthemes and unfortunately their support is very slow and not really helpful.
There is a file that contains code to resize image to some sizes.
The file is located at epanel/post_thumbnails_estore.php.
I copied it to child theme and edited the size (1st line) from 193×130 to 193×200 as shown below.$et_theme_image_sizes = array( '193x200' => 'et-entry-thumb', '1400x501' => 'et-featured-thumb', '109x109' => 'et-featured-small-thumb', '162x112' => 'et-scroller-thumb', '298x130' => 'et-single-product-thumb', '298x226' => 'et-single-product-thumb2', '44x44' => 'et-related-item-thumb', );
What else I missed? pls advise.
Thanks,
AgusComplete code of file post_thumbnails_estore.php:
<?php add_theme_support( 'post-thumbnails' ); global $et_theme_image_sizes; $et_theme_image_sizes = array( '193x200' => 'et-entry-thumb', '1400x501' => 'et-featured-thumb', '109x109' => 'et-featured-small-thumb', '162x112' => 'et-scroller-thumb', '298x130' => 'et-single-product-thumb', '298x226' => 'et-single-product-thumb2', '44x44' => 'et-related-item-thumb', ); $et_page_templates_image_sizes = array( '184x184' => 'et-blog-page-thumb', '207x136' => 'et-gallery-page-thumb', '260x170' => 'et-portfolio-medium-page-thumb', '260x315' => 'et-portfolio-medium-portrait-page-thumb', '140x94' => 'et-portfolio-small-page-thumb', '140x170' => 'et-portfolio-small-portrait-page-thumb', '430x283' => 'et-portfolio-large-page-thumb', '430x860' => 'et-portfolio-large-portrait-page-thumb', ); $et_theme_image_sizes = array_merge( $et_theme_image_sizes, $et_page_templates_image_sizes ); $et_theme_image_sizes = apply_filters( 'et_theme_image_sizes', $et_theme_image_sizes ); $crop = apply_filters( 'et_post_thumbnails_crop', true ); if ( is_array( $et_theme_image_sizes ) ){ foreach ( $et_theme_image_sizes as $image_size_dimensions => $image_size_name ){ $dimensions = explode( 'x', $image_size_dimensions ); add_image_size( $image_size_name, $dimensions[0], $dimensions[1], $crop ); } } ?>
- The topic ‘How to use Child Theme for PHP code?’ is closed to new replies.