Product description

#701129
  • Hello everyone,
    I face a problem and i want your help.

    Products has 2 descriptions. Short description and product description
    Rank math automatically collects short description for excerpt.
    How to reverse that and take the products description instead ?

    Thank you.

    this code is not working :

    /**
    * Use the Description from Global Setting, if the description is missing in the Post metabox
    */
    add_action( ‘rank_math/frontend/description’, function( $description ) {
    global $post;
    $desc = RankMathPost::get_meta( ‘description’, $post->ID );

    if ( is_product()) {
    $desc = RankMathHelper::get_settings( “titles.pt_{$post->post_type}_description” );
    if ( $desc ) {
    return RankMathHelper::replace_vars( $desc, $post );
    }
    }

    return $description;
    });

Viewing 4 replies - 16 through 19 (of 19 total)
  • Hello,

    In this case, you can try to increase the value from 150 to 160 in the following line of the filter code and see if that works for you:

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hello ,

    Thank you for everything.
    on last question ,
    how to add the the length limit for the default excerpt too ?

    Thank you.

    found it you can close the ticket!
    thanks for everything !

    Hello,

    We’re delighted to hear that this issue has been resolved. We appreciate your kind words and your support.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    I’m closing this ticket now but if you ever have another question or need any help in the future, please don’t hesitate to create a new forum topic. We’ll be more than happy to assist you again.

    Thank you for choosing Rank Math and have a wonderful day!

Viewing 4 replies - 16 through 19 (of 19 total)

The ticket ‘Product description’ is closed to new replies.