i found this code but how i can change the code to have different font for example like this https://prnt.sc/up76cg
add_filter( 'the_title', 'custom_product_title', 10, 2 );
function custom_product_title( $title, $post_id ){
$post_type = get_post_field( 'post_type', $post_id, true );
if( in_array( $post_type, array( 'product', 'product_variation') ) ) {
$title = str_replace( '-', '<br/>', $title ); // we replace "-" by "<br>"
}
return $title;
}
-
This reply was modified 5 years, 8 months ago by
mohdaljaraba.
Rynald0s
(@rynald0s)
Automattic Happiness Engineer
Hi @mohdaljaraba!
You would need to use some CSS code, or just add font-family: your_font the same way you’ve done with <br/> in your code.
Cheers!
Rynald0s
(@rynald0s)
Automattic Happiness Engineer
Howdy.
We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.
Cheers!