-
Hello,
I’ve configured the default description for single product pages under “Titles & Meta.”
The plugin displays the same until I add some product descriptions to the single product pages.
I don’t want the plugin to display product description, instead, I want it to obey the default title set for product meta description.
I read a few similar tickets in this forum, where you’ve suggested to use the following code.
/** * 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 ( ! $desc && is_product()) { $desc = RankMathHelper::get_settings( "titles.pt_{$post->post_type}_description" ); if ( $desc ) { return RankMathHelper::replace_vars( $desc, $post ); } } return $description; });However, after adding it to the child theme’s functions, the plugin still displays the product description instead of global meta description settings.
I’m using Astra theme.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
You must be logged in to reply to this ticket.