• Great plugin! Been a long time user, but would like to see additional functionality.

    I want to know if I can use the plugin title and description in my theme.

    Basically, in my theme, I want to include those fields within the loop. I am thinking of using it in my archive pages.

    So in archive.php, instead of calling the_excerpt or the_content, i would like to use the plugin’s description.

    How do i go about doing this?

    Thank you.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Michael Soriano

    (@mks6804)

    Anybody know how to do this? to clarify:

    All in One SEO has custom titles and descriptions for each post. I want to be able to echo this out in my theme.

    For example, in archive.php -> i want to use the All in One SEO description instead of the_content() or the_excerpt().

    The reason is, I have hundreds of posts, and I’ve always edited the All in One SEO title and description to be more “attractive” to the reader – and I want to use it in my archive pages. This will also make the archive pages better in Google – because it won’t show duplicate content.

    Please advise.

    michael,

    This is possible; it might be easier to set this text as a manual excerpt, as All in One SEO Pack will use that as the description if no description is present as well; but what you can do is filter the_excerpt (or the_content) and have it display the post meta _aioseop_description for the post, which is where the description is stored.

    Example:

    add_filter( 'the_excerpt', 'sfwd_aioseop_show_desc' );
    function sfwd_aioseop_show_desc( $text ) {
        global $post;
        if ( !empty( $post ) && $desc = get_post_meta( $post->ID, '_aioseop_description', true ) {
            $text = $desc;
        }
        return $text;
    }
    Thread Starter Michael Soriano

    (@mks6804)

    f*ck yeah. this is exactly what i need. thanks bro

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can we use the plugin's fields in our theme?’ is closed to new replies.