-
Hello 🙂
I have this code which applies a custom prefix on title
add_filter('the_title', 'l2j_c4', 10, 2 ); function l2j_c4 ( $title, $post_id ) { // Returns true on a single product page. if ( is_product() | is_front_page() | is_product_category() ) { // IDs of categories that should prepend the title $prepend_categories = array( 267 ); // get all categories via post id $categories = wp_get_post_terms( $post_id, 'product_cat' ); foreach ( $categories as $category ) { // Find category if ( in_array( $category->term_id, $prepend_categories ) ) { $title = '[' . 'L2J C4'. '] ' . $title; } } } return $title; } add_filter('the_title', 'l2j_c4', 10, 2 );
Results: https://prnt.sc/sp1e3y
I need help for that prefix to be applied to the URL too.
How is that possible?
Thanks in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘[Help][SEO] Custom Woocommerce Prefix on url’ is closed to new replies.