Support Forum » User Profile

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Guth-Rosenstock-ArtGuth-Rosenstock-Art
    Participant

    For 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?

    Guth-Rosenstock-ArtGuth-Rosenstock-Art
    Participant

    I 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.

    Guth-Rosenstock-ArtGuth-Rosenstock-Art
    Participant

    Dear Mr. Nguyen,
    I tried both my solutions but it didn't work. Could you post your solution to the forum? Thanks!

    Guth-Rosenstock-ArtGuth-Rosenstock-Art
    Participant

    Maybe 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;
    }
    ?>
    Guth-Rosenstock-ArtGuth-Rosenstock-Art
    Participant

    Dear 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;
    }
    ?>
Viewing 5 posts - 1 through 5 (of 5 total)