Home › Forums › WoodMart support forum › How can I wrap the Wishlist text in another tag
How can I wrap the Wishlist text in another tag
- This topic has 10 replies, 2 voices, and was last updated 1 year, 2 months ago by
Hung Pham.
-
AuthorPosts
-
January 30, 2024 at 4:14 pm #535091
ChingizParticipantHello!
How can I wrap the text “Add to Wish List” and “View Wish List” in the <noindex> tag?
Attachments:
You must be logged in to view attached files.January 31, 2024 at 8:51 am #535294
Hung PhamKeymasterHi Chingiz,
Thanks for reaching to us.
Try to edit the file
woodmart/inc/integrations/woocommerce/modules/wishlist/class-ui.php
and you can add more tags https://prnt.sc/NXyNvXgbgd93Regards,
January 31, 2024 at 10:09 am #535315
ChingizParticipantBut it will work until the first update.
January 31, 2024 at 1:39 pm #535450
ChingizParticipantPlease tell me what can be done. I’m not good at PHP. I’m trying to inherit from the ui class, but I’m not getting anywhere.
namespace XTS\WC_Wishlist; if ( ! defined( 'ABSPATH' ) ) { exit( 'No direct script access allowed' ); } use XTS\Ui; class New_Ui extends Ui { public function add_to_wishlist_btn( $classes = '' ) { woodmart_enqueue_js_script( 'wishlist' ); if ( woodmart_get_opt( 'wishlist_expanded' ) && 'disable' !== woodmart_get_opt( 'wishlist_show_popup', 'disable' ) && is_user_logged_in() ) { woodmart_enqueue_js_script( 'wishlist-group' ); } $added = false; $link_classes = ''; $text = esc_html__( 'Add to wishlist', 'woodmart' ); $product_id = apply_filters( 'wpml_object_id', get_the_ID(), 'product', true, apply_filters( 'wpml_default_language', null ) ); if ( $this->wishlist && $this->wishlist->get_all() && woodmart_get_opt( 'wishlist_save_button_state', '0' ) ) { $products = $this->wishlist->get_all(); foreach ( $products as $product ) { if ( (int) get_the_ID() === (int) $product['product_id'] ) { $added = true; } } } if ( $added ) { $link_classes .= ' added'; $text = esc_html__( 'Browse Wishlist', 'woodmart' ); } $classes .= woodmart_get_old_classes( ' woodmart-wishlist-btn' ); ?> <div class="wd-wishlist-btn <?php echo esc_attr( $classes ); ?>"> <a class="<?php echo esc_attr( $link_classes ); ?>" href="<?php echo esc_url( woodmart_get_wishlist_page_url() ); ?>" data-key="<?php echo esc_attr( wp_create_nonce( 'woodmart-wishlist-add' ) ); ?>" data-product-id="<?php echo esc_attr( $product_id ); ?>" rel="nofollow" data-added-text="<?php esc_html_e( 'Browse Wishlist', 'woodmart' ); ?>"> <noindex><span><?php echo esc_html( $text ); ?></span></noindex> </a> </div> <?php } }
January 31, 2024 at 3:20 pm #535523
Hung PhamKeymasterHi Chingiz,
Unfortunately, it is possible to change it to a parent theme.
Actually,
noindex
should be used for the page, and SEO plugins can handle that. You can read more here https://www.lumar.io/blog/best-practice/noindex-disallow-nofollow/Regards,
January 31, 2024 at 4:38 pm #535543
ChingizParticipantAs far as I know, for Yandex bot, the
rel="nofollow"
attribute allows you to hide the link, but not the text inside, we need to do this to improve relevancehttps://yandex.ru/support/webmaster/adding-site/indexing-prohibition.html
February 1, 2024 at 2:43 pm #535815
Hung PhamKeymasterFebruary 2, 2024 at 10:09 am #536081
ChingizParticipantUnfortunately, I still haven’t figured out how I can add the
<noindex></noindex>
tags herewoodmart/inc/integrations/woocommerce/modules/wishlist/class-ui.php
in the parent theme, so that my rules do not disappear the next time the woodmart theme is updated (transferring this class to the child theme does not give a result).February 3, 2024 at 9:56 am #536399
Hung PhamKeymasterHi Chingiz,
Currently, there is no workaround, you need to add it directly to parent theme and backup that file.
Regards,
February 3, 2024 at 3:10 pm #536465
ChingizParticipantI understand you. Thanks
February 3, 2024 at 8:17 pm #536536
Hung PhamKeymasterHi Chingiz,
Keep us in mind for future questions and concerns, we’re always here to help!
Regards,
-
AuthorPosts
- You must be logged in to create new topics. Login / Register