Error from using snippet to use the Description from Global Setting

#86831
  • Resolved Alice
    Rank Math pro

    Hello,

    I want RM to use the Description from Global Setting, if the description is missing in the Post metabox.
    I have added the snippet from here https://support.rankmath.com/ticket/rankmath-displays-product-description-instead-of-global-meta-description/ in functions.php but my error log reports this:

    Trying to get property ‘ID’ of non-object in …wp-content/themes/flatsome-child/functions.php on line 11
    Trying to get property ‘post_type’ of non-object in …/wp-content/themes/flatsome-child/functions.php on line 14

    line 11:
    $desc = RankMath\Post::get_meta( ‘description’, $post->ID );

    line 14:
    $desc = RankMath\Helper::get_settings( “titles.pt_{$post->post_type}_description” );

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Could you please counter-check to confirm you have added the filter correctly?

    If you have, then we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Error from using snippet to use the Description from Global Setting’ is closed to new replies.