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.

Please consider registering
guest

Log In

Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Adding Description to top of each page
July 12, 2009
11:16 pm
kevinoneil
New Member
Forum Posts: 3
Member Since:
July 13, 2009
Offline

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

July 12, 2009
11:27 pm
WordPress Professional
Admin
Forum Posts: 442
Member Since:
October 14, 2008
Offline

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
July 13, 2009
7:28 am
kevinoneil
New Member
Forum Posts: 3
Member Since:
July 13, 2009
Offline

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

July 13, 2009
1:44 pm
WordPress Professional
Admin
Forum Posts: 442
Member Since:
October 14, 2008
Offline

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
July 13, 2009
5:21 pm
kevinoneil
New Member
Forum Posts: 3
Member Since:
July 13, 2009
Offline

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

July 31, 2009
1:00 pm
ssiegrist
New Member
Forum Posts: 4
Member Since:
July 31, 2009
Offline

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

-Scott

Forum Timezone: America/New_York

Most Users Ever Online: 205

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

romiojuliat: 102

yaoming987: 50

jintuy: 50

miki1986: 33

newshow: 28

karen1234: 27

Member Stats:

Guest Posters: 0

Members: 6356

Moderators: 3

Admins: 4

Forum Stats:

Groups: 5

Forums: 23

Topics: 1546

Posts: 3450

Newest Members: carofern@cisco.com, pronto, jessie, pbaylies, ninaeast, freda

Moderators: davecashmore (2), aaron (5), tempadmin (0)

Administrators: WordPress Professional (442), hallsofmontezuma (202), onefinejay (10), stevemortiboy (4)