Problem with get_post
-
Hi, I am new to WordPress (and PHP) and have built my first WP site: https://www.thecssgallerylist.com.
What I am trying to do is have a unique description on each page, pulled from the content. So far I have:
<?php
if (is_home()) {
$description = “Save yourself time and submit your site to over 100 CSS website galleries all from one location – The CSS Gallery List.”;
} else {
$description = get_post($post_content);
}
if ($description) {
echo “<meta name=\”description\” content=\”$description\” />\n”;
}
?>This returns ‘Object’ in the description meta tag when not on the home page. Any help would be much appreciated.
Cheers,
Klaye
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problem with get_post’ is closed to new replies.