<?php
$customField = get_post_custom_values("full");
if (isset($customField[0])) {
//Custom field is set, display a full post
the_content();
} else {
// No custom field set, let's display an excerpt
the_excerpt();
?>
[<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">full article</a>]
<br />
<?php
}
?>
So what is this code actually doing? This code checks for a custom field on the post. In the case of the code above, it is looking for the custom field "full" but this can be changed to anything. Also, the value for "full" can be anything, it is simply checking that it exist. If the field "full" exists, then the full post is shown. If it does not exist, then only an excerpt from the post is shown.
What is a custom field? When you make a new post in WordPress, or when you import a post, scroll down below where you add your post text, and you will find a box named "Custom Fields." You can add a field to a post here when you make or edit a post. In the case of my blog, if I make a personal post I simply add the field "full" and set the value to "yes" (although what I set the value to is irrelevant.)
And where does this code go? The code above can replace the normal code that calls a post in several files of your blog. All of these files will be located in /wp-content/themes/yourtheme. The names of the files can vary, but try looking for some of these common file names: index.php, archive.php, archives.php, category.php, search.php
You are replacing the code that looks like this:
<?php the_content('[...]'); ?>Have another way to do this? Share your code here, or view other's solutions!

