This topic has 2 replies, 1 voice, and was last updated 1 years, 3 months ago ago by IP
Hello
My website has slightly messed up when I updated the Parent theme.
This is because I had made changes to the XSTORE parent theme folder- i am aware XSTORE and WordPress doesn’t recommend this and xstore says to modify the CHILD instead.
The file I have modified is in the PARENT theme folder (WP-Content > Theme > XSTORE > WooCommerce > Loop)
Is there a way to add this file to the CHILD folder? So next time I update the parent Theme there wouldn’t be this issue? The code for this file is below
Thanks
The code for the file i created in WP-Content > Themes > XSTORE > WooCommerce > Loop:
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $product;
if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) {
return;
}
$rating_count = $product->get_rating_count();
$review_count = $product->get_review_count();
$average = $product->get_average_rating();
if ( $rating_count > 0 ) : ?>
<?php echo wc_get_rating_html($average, $rating_count); ?>
<?php if ( comments_open() ): ?><a href="<?php echo get_permalink() ?>#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s',$review_count,'woocommerce' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a><?php endif ?>
<?php endif; ?>
Hello, I have figured out what to do, thanks.
For anyone else wanting to achieve the same, simply copy the folder to XSTORE Child folder and change values in XSTORE Child
Example – I copied LOOP folder (from WP-Content > Theme > XSTORE > WooCommerce > Loop) and put it in XSTORE Child, then added the file with the code above and it works
I also updated the theme after doing this and can confirm it still works
Thanks
The issue related to '‘A way to add XSTORE theme files to CHILD?’' has been successfully resolved, and the topic is now closed for further responses