How to add nofollow to frontpage only? (Woocommerce products, internal links)

Question

Currently it add nofollow at all products across website, how to make it at front page only?..

function woocommerce_template_loop_product_title() {
    echo '<p class="name product-title ' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '"><a href="' . get_the_permalink() . '" rel="nofollow">' . get_the_title() . '</a></p>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
0
Formel Eins 3 months 0 Answers 14 views 0

Leave an answer