How To Use Costum Field Data in WordPress?
I am a video blogger for http://gamerglitches.com. All of my posts are just embedded YouTube videos. I have a plugin which generates a thumbnail for the video, and the plugin creates a custom field called “thumbnail” and the value is the path (URL)to the thumbnail. I want to somehow create on the front of my blog, a row of latest or recent posts, with a thumbnail, then to the left of that, the post title(just like the home page of gamerglitch.com). However, I don’t know much PHP. I have created a second page template to get started, but I need some help on where to go from there. Pretty much, I need the php code to create a display to show the post title, and thumbnail from a custom field. HELP????????
This might be a bit more than I can type out on here, but I’ll try to get you started.
Give your new template a name so you can link your new page to that template, if you need help doing that check out :
http://www.thewordpressblog.com/theming/creating-a-new-page-template/
Now on to the fun stuff. Let’s get the 5 most recent posts:
global $post; //we need to be able to use the $post variable, so get it queued up
// first lets set a variable with all of the settings we'll need for our query
$args = array(
'numberposts' => 5,
‘orderby’ => ‘post_date’,
‘order’ => ‘DESC’,
‘post_type’ => ‘post’,
‘post_status’ => ‘published’ );
//great, now let’s query the database
$latestposts = get_posts( $args );
//now we have the 5 latest posts, lets display them one by one
?>
foreach ($latestposts as $post):
setup_postdata($post); //this function sets up the post so we can use wp functions like the_title();
?>
- “>

|
Professional WordPress (Wrox Programmer to Programmer)
$44.99
An in-depth look at the internals of the WordPress system. As the most popular blogging and content management platform available today, WordPress is a powerful tool. This exciting book goes beyond the basics and delves into the heart of the WordPress system, offering overviews of the functional aspects of WordPress as well as plug-in and theme development.What is covered in this book?WordPress as…
|

|
World Class Blogging
These days is seems like almost everyone is blogging. From teenagers to retirees, single moms to CEOs of major corporations, blogging seems to be the new “in” thing.But most people never have readers outside their group of family and friends. There are a number of reasons for this, and we’re going to cover the most important of those in this report. You’re going to learn how to make sure your blog…
|