Home › Forums › WoodMart support forum › Problems with the Child Theme and Site Indexing
Problems with the Child Theme and Site Indexing
- This topic has 8 replies, 4 voices, and was last updated 4 months, 4 weeks ago by Artem Temos.
-
AuthorPosts
-
July 5, 2024 at 11:42 am #581169
cionirodolfoParticipantHello forum,
I have a problem that I can’t solve. The issue lies with the child theme. When I activate it, the site becomes non-indexable by search engines.
When I run a scan with Screaming Frog, the site returns a 403 error (see attachment). However, using the parent theme, the problem disappears.
I have tried running the child theme with only the necessary plugins, but the issue remains. Additionally, I see this error in a loop: woodmart/woocommerce/loop/add-to-cart.php on line 41.
Can someone help me?
Thank you very much to everyone who reads this and tries to assist me.Thanks,
Foffo75Attachments:
You must be logged in to view attached files.July 5, 2024 at 1:58 pm #581239
Aizaz Imtiaz AwanKeymasterHello,
Maybe the problem is likely caused by custom code added to the child theme. Please review any custom code you have added to the child theme to identify and resolve the issue.
Best Regards.
July 5, 2024 at 4:27 pm #581324
cionirodolfoParticipantGood evening,
I have activated the child theme. I tried emptying the child theme, but the result did not change. Could someone check if I’m missing something?
<?php
/**
* Enqueue script and styles for child theme
*/
function woodmart_child_enqueue_styles() {
wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( ‘woodmart-style’ ), woodmart_get_theme_info( ‘Version’ ) );
}
add_action( ‘wp_enqueue_scripts’, ‘woodmart_child_enqueue_styles’, 10010 );/**
* Only show products in the same sub categories in the related products area
*
* @param $terms – Terms currently being passed through
* @param $product_id – Product ID of related products request
* @return $terms/$subcategories – Terms to be included in related products query
*/
function blz_filter_related_products_subcats_only($terms, $product_id) {
// Check to see if this product has only one category ticked
$prodterms = get_the_terms($product_id, ‘product_cat’);
if (count($prodterms) === 1) {
return $terms;
}// Loop through the product categories and remove parent categories
$subcategories = array();
foreach ($prodterms as $k => $prodterm) {
if ($prodterm->parent === 0) {
unset($prodterms[$k]);
} else {
$subcategories[] = $prodterm->term_id;
}
}
return $subcategories;
}
add_filter( ‘woocommerce_get_related_product_cat_terms’, ‘blz_filter_related_products_subcats_only’, 20, 2 );//Aggiunte per aumentare la velocità di caricamento
//For Google Fonts:
add_filter( ‘elementor/frontend/print_google_fonts’, ‘__return_false’ );//For Font Awesome:
add_action(‘elementor/frontend/after_register_styles’,function() {
foreach( [ ‘solid’, ‘regular’, ‘brands’ ] as $style ) {
wp_deregister_style( ‘elementor-icons-fa-‘ . $style );
}
}, 20 );//For Eicons:
add_action( ‘wp_enqueue_scripts’, ‘disable_eicons’, 11 );
function disable_eicons() {
wp_dequeue_style( ‘elementor-icons’ );
wp_deregister_style( ‘elementor-icons’ );
}//For redirect CF7:
add_action( ‘wp_footer’, ‘wpm_redirect_cf7’ );
function wpm_redirect_cf7() { ?>
<script type=”text/javascript”>
document.addEventListener(‘wpcf7mailsent’, function(event) {
location = ‘https://www.manichinimoda.com/thxcf7’;
}, true);
</script><?php }
/**
* Add Continue Shopping Button on Cart Page
* Add to theme functions.php file or Code Snippets plugin
*/add_action( ‘woocommerce_before_cart_table’, ‘woo_add_continue_shopping_button_to_cart’ );
function woo_add_continue_shopping_button_to_cart() {
$shop_page_url = get_permalink( woocommerce_get_page_id( ‘shop’ ) );echo ‘<div class=”woocommerce-message”>’;
echo ‘ Contnua con gli acquisti cliccando sopra questa scritta‘;
echo ‘</div>’;
}July 6, 2024 at 9:21 am #581419
Aizaz Imtiaz AwanKeymasterHello,
Please once delete the Child Theme on your Site > and then recreate it and then check back the issue again. Hopefully, you won’t have any issues by then.
The following article describes how to install a child theme manually:
https://xtemos.com/docs-topic/setup-child-theme/Best Regards.
July 17, 2024 at 4:17 am #583784
MikeParticipantHello,
last days I see this error in a loop: woodmart/woocommerce/loop/add-to-cart.php on line 41. No plugin has been plugin here for months. No plugin has been new plugin here for months.July 17, 2024 at 9:10 am #583831
Artem TemosKeymasterHello,
Please disable any plugins not directly related to our theme and provide us with your admin access details. We will log in to your dashboard and investigate the issue. Please ensure that you only keep the following plugins that are necessary for our theme to work correctly:
– WoodMart core
– WooCommerce
– Elementor/WPBakery Page BuilderThank you in advance.
July 17, 2024 at 11:51 am #583915
cionirodolfoParticipantGood morning,
I confirm that only the following plug-ins are active:– WoodMart core
– WooCommerce
– Elementor/WPBakery Page BuilderBest regard
Foffo75July 17, 2024 at 11:52 am #583916
cionirodolfoParticipantAdd website stage:
July 17, 2024 at 12:24 pm #583936
Artem TemosKeymasterAs we can see, your website is working correctly while the child theme is activated. Could you please check it now from your end?
-
AuthorPosts
- You must be logged in to create new topics. Login / Register