Hi. I am Marian, the owner of WPCONCEPT. I am a freelancer web designer focused on web development and i am a big fan of wordpress. I am from Transylvania, Romania and please excuse my grammar mistakes. I do my best to improve my english skills.

  • Home
  • Hosting
  • Contact

Custom fields in wordpress

by admin on 24 November 2009

Custom fields in wordpress are important if you want to use custom functions in your theme or if you want to have a clean design. The implementation of custom fields is relatively easy.

Open your style.css file and paste the following code:

.leadpic {
float:left;
width:200px;
height:100px;
border:1px solid #bebebe;
padding:5px;
margin:10px 10px 10px 10px;
}

The code above can be customized as you want.

Now open the index.php file and search the following code:

<?php if (have_posts()) : while (have_posts()) : the_post

Under this code paste the following code:

<?php
$values = get_post_custom_values("Image");
if (isset($values[0])) {
?>
<div>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" width="200px" height="100px" /></a>
</div>
<?php } ?>

To use this custom field you must add a new custom field from wordpress post options.

On the key field put image and on the value field put your image url.

The entire code from this article can be easily customized. For any questions feel free to post a comment.

This entry was posted on Tuesday, November 24th, 2009 at 3:43 pm and is filed under How to. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Custom fields in wordpress”

  1. by Christian Louboutin on 11 June 2010 - Permalink

    my favorite web page. thank you

Click here to cancel reply.

  • Be in touch

  • Domains for sell

    wpdesigner.net

    wpfreelancer.net

    If you are interested please contact me.

  • Categories

    • How to
    • Themes
    • Tips
    • Tutorials
  • Archives

    • May 2010
    • December 2009
    • November 2009
  • Blogroll

    • Freelance Folder
    • WPRecipes
    • WPShout
    • WPZoom
  • Tags

    after each post branding custom content custom fields custom page template favicon free free theme free wordpress theme logo multiple sidebars online portfolio theme premium wordpress themes rss feed seo optimization social networks theme themeforest Themes visitors wordpress wordpress cms wordpress custom fields wordpress plugins wordpress security wordpress seo optimization wordpress sidebars wordpress templates wordpress theme wordpress themes wordpress theme tutorials wpzoom

© 2010 WPCONCEPT + wordpress resources
powered by wordpress

www.wpconcept.com