How to get the long description of the product to display it in the header [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 20 hours ago. Improve this question I want to display the long description of a product as the meta description in the header. This is the first option I used and the excerpt code worked perfect. <head> <meta name="description" content="<?php $excerpt = ''; if (has_excerpt()) { $excerpt = wp_strip_all_tags(get_the_excerpt()); echo $excerpt; } ?>"/> But I want the long description to be displayed so I changed to this but it does not work. <head> <meta name="description" content="<?php $description = ''; if (has_description()) { $description = wp_strip_all_tags(get_the_description()); echo $description; } ?>"/> </head>

Comment (0)

You’ll be in good company