Support » Fixing WordPress » Display meta ‘description’ on a page

  • Resolved wjl11

    (@wjl11)


    Is there a way to display what is contained in the meta ‘description’ tag of my page?

    I thought since there is an option to display the page title:
    <h1><?php the_title(); ?></h1> …
    that you could do the same for the page description.

    Thanks,
    Will

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’d recommend a meta tags or SEO plugin.

    I have an SEO plugin which enables you to change the meta page description. I want to DISPLAY it within the text of the page.

    For example:
    The meta description of this page is: <?php the_description(); ?>

    It depends how the meta description is generated. If it is in a custom field, then you could display the custom field.

    http://codex.wordpress.org/Using_Custom_Fields

    It is not a custom field.
    It’s a standard meta ‘description’ created by the All-in-One-SEO-Pack plugin.
    I’m trying to use the meta ‘description’ within an H2 tag.

    It is not a custom field.
    It’s a standard meta ‘description’ created by the All-in-One-SEO-Pack plugin.

    You could try looking in the plugin code to find a function/variable that you could use.

    I found the answer on Darren Pangan‘s page:

    <?php echo get_post_meta($post->ID, ‘description’, true) ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display meta ‘description’ on a page’ is closed to new replies.