WordPress.org

Forums

[resolved] Display meta 'description' on a page (7 posts)

  1. wjl11
    Member
    Posted 6 years ago #

    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

  2. iridiax
    Member
    Posted 6 years ago #

    I'd recommend a meta tags or SEO plugin.

  3. wjl11
    Member
    Posted 6 years ago #

    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(); ?>

  4. iridiax
    Member
    Posted 6 years ago #

    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

  5. wjl11
    Member
    Posted 6 years ago #

    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.

  6. iridiax
    Member
    Posted 6 years ago #

    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.

  7. wjl11
    Member
    Posted 6 years ago #

    I found the answer on Darren Pangan's page:

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

Topic Closed

This topic has been closed to new replies.

About this Topic