Publishing System Settings Logout Login Register
WordPress - Custom Related Posts
TutorialCommentsThe AuthorReport Tutorial
Tutorial Avatar
Rating
Add to Favorites
Posted on October 8th, 2011
1307 views
Wordpress

Usage of WordPress' feature "Custom Fields" can save a lot of time if you would like to add certain elements to your blog / website such as thumbnails, or if you are familiar with deviantART.com you can add fields like they have on your Journal posts. I will go over both examples in this tutorial so you can learn how to use the Custom Fields to deal with images, or plain text, then you may experiment on your own of course.

First off, lets' deal with a thumbnail image that will appear beside the post. Scroll down to where you see the Custom Fields section below where your post body would be typed out. For the key put thumb and for the value enter the URL to your image. For example mine would be: wp-content/themes/ndn/images/mythumb.jpg

Now open index.php and type the following where you would like your thumbnail to appear inside your WordPress loop.

 

<img src"<?php echo get_post_meta($post->ID, 'thumb', true); ?>" alt="" border="0" align="left" />

This should display your thumbnail aligned to the left of your post. :)

Now lets' do something similar to deviantARTs' Journal. We are going to use three (3) custom fields: Mood, Currently Doing, and

 

Dig this tutorial?
Thank the author by sending him a few P2L credits!

Send
NewDevNation

I love to help others increase their knowledge in developing in general or using WordPress.
View Full Profile Add as Friend Send PM
Pixel2Life Home Advanced Search Search Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Pixel2life Homepage Submit a Tutorial Publish a Tutorial Join our Forums P2L Marketplace Advertise on P2L P2L Website Hosting Help and FAQ Topsites Link Exchange P2L RSS Feeds P2L Sitemap Contact Us Privacy Statement Legal P2L Facebook Fanpage Follow us on Twitter P2L Studios Portal P2L Website Hosting Back to Top