WordPress.org

Forums

All in One SEO Pack
meta description as post content (8 posts)

  1. studiosx
    Member
    Posted 2 years ago #

    Hi,

    I want to insert meta description in post content.
    Is there anyway I can do this?

    http://wordpress.org/extend/plugins/all-in-one-seo-pack/

  2. oblanda004
    Member
    Posted 1 year ago #

    I want this too. Is there some easy setup to do this automatic for every post?

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    @oblanda004: If you require assistance then, as per the Forum Welcome, please post your own topic.

  4. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    studiosx,

    The meta description is stored as custom metadata on the post, it is named _aioseop_description and you can do this using the get_post_meta() function and the "the_content" filter. Note that if you want to insert it in an arbitrary location within the post content, you might want to write a shortcode for this instead.

  5. oblanda004
    Member
    Posted 1 year ago #

    I know that is not your job and maybe this reques is retarded but can you tell me how to write that shortcode. I am noob, stupid and Bosnian. Please.

  6. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    oblanda004,

    I don't mind providing simple examples; the main issue is figuring out exactly what people are trying to accomplish in the first place, when they ask a question. Here's a simple example of how you'd do this:

    function oblanda_description_shortcode( $atts ) {
        global $post;
        $meta = '';
        if ( !empty( $post ) ) {
            $meta = get_post_meta( $post->ID, '_aioseop_description', true );
        }
        return $meta;
    }
    add_shortcode( 'showdesc', 'oblanda_description_shortcode' );

    Then you'd use the [showdesc] shortcode in the post content. You can add this code to the functions.php in your theme or to a plugin.

  7. oblanda004
    Member
    Posted 1 year ago #

    I trying to accomplish in the first place to not write content. I have video site and i thinking to have short description in post that would be and meta description and post content. I trying to have post meta description to look like this
    %post_title% | some text | %blog_title% | some text
    And that automatic be posted in my post to reduce writing. I hope you understand me and my tarzanian english. Is posible to doing that what i want?
    Thanks for help.

  8. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    Oblanda,

    In that case, you might want to look into using the post_content hook I mentioned earlier instead; I'm not sure how you'd go about automating the "some text" part either, unless that text doesn't change.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All in One SEO Pack
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic