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.
Topic RSS
11:16 pm
July 13, 2009
OfflineFirst 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
11:27 pm
October 14, 2008
OfflineYou must be a subscriber to view administrator posts. Click here to purchase a support subscription.
1:44 pm
October 14, 2008
OfflineYou must be a subscriber to view administrator posts. Click here to purchase a support subscription.
5:21 pm
July 13, 2009
OfflineThank you for the reply.
Here is the code I have so far and it works 100% to what I need to accomplish.
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
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)




Log In
Home


