Adding Description to top of each page Configuring All in One SEO Pack Forum

The support forums have a new home! Please visit All in One SEO Pack's new residence at Semper Plugins to purchase a support plan.

 
You must be logged in to post
Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Adding Description to top of each page

Post
New Member

kevinoneil

posts 3

11:16 pm July 12, 2009

First off I would like to thank you for making such an awesome plugin and support forum.

I would like to know how can we grab the description data from the page, post and such and place it at the top of each page?

I had this working but now that I upgraded to 2.8.1 it doesn't work at all.

Here is the code I had:

<?php
global $wp_query;
$curauth = $wp_query->get_queried_object();
 
if (is_single()) { 
echo get_post_meta($wp_query->post->ID,'description',true); 
} elseif (is_category()) {
echo str_replace(array('<p>', '</p>'), '', category_description());
} elseif (is_tag()) {
echo "The Tag ";
$tagdata = single_tag_title();
echo " is brought to you by Kevin's Lair.";
} elseif (is_home()) {
bloginfo('description');
} elseif (is_author()) {
echo $curauth->description;
} elseif (is_page()) {
echo get_post_meta($wp_query->post->ID,'description',true); 
} else {
bloginfo('description');
}
?>

Is there an easier way to just grab the aioseo description and place it there?

Thanks,

Kevin

Admin

WordPress Professional

Raleigh, NC

posts 442

11:27 pm July 12, 2009

Post edited 5:28 am – July 13, 2009 by WordPress Professional
Post edited 5:28 am – July 13, 2009 by WordPress Professional


You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man if he shall gain the whole world and lose his own soul

New Member

kevinoneil

posts 3

7:28 am July 13, 2009

Thank you for the reply.

I am a total newb to wordpress. How do I use aioseop_description?

is it like this:

<?php bloginfo('aioseop_description'); ?>

I really don't know.

Thanks,

Kevin

Admin

WordPress Professional

Raleigh, NC

posts 442

1:44 pm July 13, 2009

You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man if he shall gain the whole world and lose his own soul

New Member

kevinoneil

posts 3

5:21 pm July 13, 2009

Thank you for the reply.

Here is the code I have so far and it works 100% to what I need to accomplish.

<?php

global $wp_query;
$curauth = $wp_query->get_queried_object();
$post_id = $wp_query->post->ID;
$key = "_aioseop_description";
$single = "true";

if (is_single()) {
echo get_post_meta($post_id, $key, $single);
} elseif (is_category()) {
echo str_replace(array('<p>', '</p>'), '', category_description());
} elseif (is_tag()) {
echo "The Tag ";
$tagdata = single_tag_title();
echo " is brought to you by Kevin's Lair.";
} elseif (is_home()) {
bloginfo('description');
} elseif (is_author()) {
echo $curauth->description;
} elseif (is_page()) {
echo get_post_meta($post_id, $key, $single);
} else {
bloginfo('description');
}

?>

I have this at the top of my pages and it works great.

Thanks,

Kevin

New Member

ssiegrist

posts 4

1:00 pm July 31, 2009

I would like understand what effect this has in search engines and where exactly would such a script be located…page.php?

-Scott


About the WordPress Developer Forum

Forum Timezone: America/New_York

Most Users Ever Online: 205

Currently Online:
31 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 5
Forums: 23
Topics: 1543
Posts: 3447

Membership:

There are 6357 Members

There are 4 Admins
There are 3 Moderators