Forum Replies Created
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
August 4, 2022 at 5:55 PM in reply to: ℹ️How to target a MeTABOX custom field attached to a Woo product #37345
Guth-Rosenstock-Art
ParticipantFor some reason mine doesn't . I am using ScriptOrganizer from DPlugins and Oxygen. While the script works for woo product names when I try the same script (altered as you suggested) it doesn't work. Should I make the script active on everywhere or hide it in the builder?
August 3, 2022 at 3:41 AM in reply to: ℹ️How to target a MeTABOX custom field attached to a Woo product #37321Guth-Rosenstock-Art
ParticipantI click on the link to see your solution but it just opens the same page as before with my nonworking versions.
I really need your help since I am going live next week.August 3, 2022 at 3:35 AM in reply to: ℹ️How to target a MeTABOX custom field attached to a Woo product #37320Guth-Rosenstock-Art
ParticipantDear Mr. Nguyen,
I tried both my solutions but it didn't work. Could you post your solution to the forum? Thanks!July 31, 2022 at 2:42 PM in reply to: ℹ️How to target a MeTABOX custom field attached to a Woo product #37288Guth-Rosenstock-Art
ParticipantMaybe this instead?
<?php /*ADD LINE BREAK */ 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 ); $metabox_title = rwmb_meta( 'display_entree_name', '', $post_id ); if( in_array( $post_type, array( 'product', 'product_variation', $metabox_title) ) ) { $title = str_replace( '|', '<br/>', $metabox_title ); // we replace "|" by "<br>" } return $title; } ?>July 31, 2022 at 2:12 PM in reply to: ℹ️How to target a MeTABOX custom field attached to a Woo product #37287Guth-Rosenstock-Art
ParticipantDear Mr. Nguyen,
I am just a rank beginner. I also am in awe of your talent! would this work?<?php /*ADD LINE BREAK */ 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') ) ) { $metabox_title = rwmb_meta( 'display_entree_name', '', $post_id ); $title = str_replace( '|', '<br/>', $metabox_title ); // we replace "|" by "<br>" } return $title; } ?> -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)