Extend WordPress With Custom Fields

Advertisement

WordPress’ popularity has grown exponentially as of late. This rise in popularity is due in part to WordPress’ custom fields. Custom fields allow you to add little bits of data to posts. They have changed the way people look at WordPress. A couple of years ago, WordPress was a blogging platform — a good one, but a blogging platform nonetheless. Now it’s widely considered to be an excellent simple content management system. How did it evolve so quickly? Custom fields, that’s how.

How exactly did these bits of data transform WordPress? The fields could initially include the weather — as the codex points out — the temperature and various other not-particularly-useful things. And that was the story for a while. Then people started to realize that they could use the custom fields to store URLs of images. They could then pull these images to the home page to create magazine-style layouts. These magazine themes, as they became known, evolved, and eventually you were able to pull images automatically from posts. You can draw a direct line from WordPress’ popularity to the magazine themes to custom fields.

The Custom Field Syntax

custom-fields1

In order to do more complicated things, you’ll need to understand the syntax. Creating a custom field is easy: it requires a name and a value. The name is constant, but the value can change with each post.

A real-world example: let’s say you run a blog about cameras. You have categories set up for each type of post (“Review,” “New,” etc.), and you tag the post with the manufacturer’s name. But you want to display the price and specifications of the camera. This is as easy as creating a new custom field with the name Camera_Specs and then typing the info into the value box. Click the “Add” button and you will have added the custom field to the post.

Displaying the field on the page is simple, too. In the single.php file, add the following code:

<?php echo get_post_meta($post->ID, "Camera_Specs", true); ?>

(You might want to wrap this in a paragraph, ordered list or the like. You can use HTML in the value of the field.)

Custom fields can be conditional, too. We can display a camera’s specs or, if that isn’t available, some generic text.

<?php $camera_specs = get_post_meta($post->ID, 'Camera_Specs', true);
if ($camera_specs) {
?>
<?php echo $camera_specs; ?>

<?php } else { ?>

<p>No specification available.</p>

<?php } ?>

That’s the general syntax, and now the only limit is your imagination!

Spicing Up Post Titles

custom-fields-title2

Post titles are usually fairly boring. You’re limited to text. Links aren’t possible, nor is HTML. Well, not anymore. Custom fields to the rescue!

Using a conditional statement and custom fields, adding any HTML to your posts’ titles is now possible. (This won’t work with RSS feeds or the like, but it works great for any titles on the blog itself.) We’ll use the custom field Post-Title:

custom-fields-post-title3

You can add any HTML you like to your posts’ titles. Implementing it on your blog is easy, too. You’ll have to use the following code on all pages on which titles are displayed: the home page, archives, current posts, etc. The following snippet looks for the custom field and falls back on the_title:

<?php $post_title = get_post_meta($post->ID, 'Post-Title', true);
if ($post_title) {
?>
<h2><?php echo $post_title; ?></h2>

<?php } else { ?>

<h2><?php the_title(); ?></h2>

<?php } ?>

An easy yet effective way to improve your website.

Only Display Posts With A Specific Custom Field

WordPress displays posts through something called a loop. Another WordPress function, query_posts, allows you to choose exactly which posts are displayed in your loop. One parameter lets you display only posts that have a custom field and/or that have a specific custom field value. Going back to our camera website, we could display only posts that have the custom field Camera_Specs:

query_posts('meta_key=Camera_Specs');

If we wanted to display only cameras that had 10 megapixels (and if all posts had the custom field Camera_Specs_Pixels that specified the value of the number of megapixels), we could do so with the following:

query_posts('meta_key=Camera_Specs_Pixels&meta_value=10');

You may want to do this on a custom page template. If so, just add the following to the top of the file and name it appropriately (e.g. camera-specs-pixels.php):

<?php /*Template Name: Camera Specs Pixels */?>

To make your new page template show up, create a new page, and then in the drop-down on the right, choose the page template you’ve just created. Publish the post, and you’re done!

Using Custom Fields To Create A Unique Design

WordPress 2.7 introduced the post_class function. This allows you to apply specific CSS classes to posts (thus giving them unique designs). Guess what? You can use custom fields to apply particular classes!

This one is a bit more involved. First, open your functions.php file and add the following code:

function shiftnews_post_class($classes) {
   global $post;
   $sn_post_class_array = array (
      get_the_author_meta('display_name'),
      get_post_meta($post->ID, 'post-class', true)
   );
   $classes[] = implode(" ", $sn_post_class_array);
   return $classes;
}

You’ll then need to edit your single.php file, adding <?php post_class(shiftnews_post_class()); ?> to a DIV that wraps your content. Using the custom field post-class, you can then type in CSS classes (e.g. flower-bg or blue-content, which would apply the classes .flower-bg or .blue-content), thus adding them to the post.

The possibilities here are inspiring, and this is quite possibly the best way to create a unique post design for WordPress.

Set a different background for each post with custom fields

Screenshot

You could take this even further by allowing users to choose a background image through custom fields. Of course, you could just resize the image to 1920×1200, upload it and copy the URL into a custom field, ‘background’ and then put the following code in your header:

<?php if (is_page() || is_single()) {

<?php $background = get_post_meta($post->ID, 'background', true);
if ($background) {
?>
<style type="text/css">body{ url(<?php echo $background; ?>) no-repeat fixed; }</style>

<?php }
}?>

But that would be a pain to do every single time you just wanted to change the background image. There is an easy way to do it: upload an image, copy the URL into a custom field and then use a script to resize the image and set it as the background.

First thing to do is to upload an image. We’re going to be resizing it to 1920px (although depending on your audience you may want to use a higher/lower resolution) so anything that’s 1200px wide or above should look fine.

Copy the relative URL of the image (ie /wp-content/… , not http://yoursite.com/wp-content/) into a custom field called ‘background’ and click ‘add custom field’. Next, we need something to resize the images with. We’ll be using timthumb4. Upload it to /yourtheme/timthumb/ and we’re ready to go!

Open up your header once again and add (below your theme’s stylesheet) the following:

<?php if (is_page() || is_single()) {

<?php $background = get_post_meta($post->ID, 'background', true);
if ($background) {
?>
<style type="text/css">background: url(<?php bloginfo('template_url'); ?>/timthumb/timthumb.php?w=1920&zc=1&src=<?php echo $background; ?>) fixed no-repeat;</style>

<?php }
}?>

What that does is takes the image from the custom field and then runs it through timthumb so it gets resized to fill the entire screen, even on large monitors (the image then gets cached, so it is only generated once). The resized image is then displayed as the background of the post.

If you’re having problems, make sure you’ve got the relative URL and not the absolute URL of the image, it is hosted on your server (you’re not hotlinking!) and that you have the file permissions set correctly (as shown in the timthumb wiki). This is one of my favourite things to do with custom fields as not only is it easy to do, but it’s also very effective in differentiating different blog posts; this technique is used to great effect on Nometet.com5.

Search Engine Optimization With Custom Fields

The “All in One SEO Pack” is consistently one of the most popular plug-ins for WordPress. It allows you to do things like specify your own title tag or meta description. It is powered by custom fields, meaning you can recreate it in your theme.

Start by adding the following code to your theme’s title tag:

<?php if ( is_single() || is_page() ) { ?><?php $title = get_post_meta($post->ID, 'Title', true);  if ($title) { ?>
<?php echo $title; ?> | <?php bloginfo('name'); ?>
<?php } else { ?>
<?php wp_title(''); ?> | <?php bloginfo('name'); ?>
<?php } ?>
<?php } ?>

Now, when a page or post is displayed, WordPress will look for the custom field Title. If it exists, its contents will be displayed; if it doesn’t, then the post’s title will be displayed. To use this new-found power, create the custom field Title and make its value what you want to be displayed in the title tag (note that | [Blog name] will be added).

You can apply the same idea to other elements, such as the description tag:

<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php $description = get_post_meta($post->ID, 'Description', true);  if ($description) { ?><?php echo get_post_meta($post->ID, "Description", true); ?>
<?php } else { ?><?php the_excerpt_rss(); ?><?php } ?>" />
<?php endwhile; endif; elseif(is_home()) : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>

The code above should replace the entire description tag and allow you to use the custom field Description to display the contents of the description tag. If the custom field does not exist, then the excerpt is used on posts and pages, and the blog’s description (which you set when you installed WordPress) is used on the home page.

Read more on the topic in the article WordPress SEO: The Definitive Guide To Higher Rankings For Your Blog6.

Custom This, Custom That!

Custom fields are very powerful, and the only limit is your imagination! As we’ve seen in this post, you can do some really awesome things with WordPress’ custom fields. They can improve both your blog and its ranking in search engines. Enjoy!

If you’d like to do some further reading:

The possibilities for this are inspiring, and this is quite possibly the best way to create a unique post design for WordPress.

Of course, the other option is to use custom fields to include a style sheet that is specific to the post or even just to use inline styling.

You can add a style sheet to a post with a custom field value quite easily. First, add the following code to the header.php file, after your theme’s style sheet loads:

<?php if (is_page() || is_single()) {

<?php $stylesheet = get_post_meta($post->ID, 'Stylesheet', true);
if ($stylesheet) {
?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?><?php echo $stylesheet; ?>.css" type="text/css" media="screen,projection,tv" /></h2>

<?php }
}?>

This tells WordPress to look for the custom field Stylesheet on posts and pages. All you’ve got to do is enter the name of the style sheet (so if it’s blue.css, just enter the value blue) and upload it to your theme’s directory.

A whole new style sheet might be overkill in some cases, though. If you’re changing just one or two styles, then inline styling might be the way to go. This is just as easy: paste the following code into your header.php file, again after your theme’s style sheet loads:

<?php if (is_page() || is_single()) {

<?php $styles = get_post_meta($post->ID, 'Styles', true);
if ($styles) {
?>
<style type="text/css"><?php echo $styles; ?></style>

<?php }
}?>

This piece of code looks for the custom field Styles; put in it any styling you want to apply only to that post. For example:

body{
    color:#000;
    background:#fff;
}

There’s something for everyone here, so you can start to quickly create unique post designs however you prefer! You might want to look at Smashing Magazine’s previous post about custom fields11 as well.

(al)

Footnotes

  1. 1 http://coding.smashingmagazine.com/wp-content/uploads/2010/02/custom-fields.jpg
  2. 2 http://coding.smashingmagazine.com/wp-content/uploads/2010/02/custom-fields-title.jpg
  3. 3 http://coding.smashingmagazine.com/wp-content/uploads/2010/02/custom-fields-post-title.jpg
  4. 4 http://code.google.com/p/timthumb
  5. 5 http://nometet.com
  6. 6 http://yoast.com/articles/wordpress-seo/
  7. 7 http://wpshout.com/10-awesome-things-to-do-with-wordpress-custom-fields/
  8. 8 http://perishablepress.com/press/2008/12/17/wordpress-custom-fields-tutorial/
  9. 9 http://perishablepress.com/press/2008/12/22/wordpress-custom-fields-tips-tricks/
  10. 10 http://www.wprecipes.com/create-custom-read-more-links-on-your-wordpress-blog
  11. 11 http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/

↑ Back to topShare on Twitter

Alex Denning is a WordPress developer from London, England. He sells WordPress themes and writes about WordPress .

Advertising
  1. 1

    Custom fields is often not used to its full potential in WordPress – glad you guys have covered it here :)

    I’d love to know more about creating and using custom fields in the user/author profiles too please (with examples).

    -1
  2. 2

    Wow, didn’t realise wordpress got so complex for something so simple.

    If you are planning anything outside of a pure blog, I would go with Drupal ;).

    Most themes in Drupal output a range of body classes for advanced stylesheets.

    -1
  3. 3

    Hunter Satterwhite

    April 29, 2010 12:09 pm

    Great post by Smashing Magazine. I really like the practical application here and not the typical things I see where people try to create extensive functionality out of this by mimicking content types.

    When it’s time to get down and dirty I use PodsCMS for WordPress: http://www.podscms.org/

    1
  4. 4

    For a first post, it is really helpfull that somebody added all these custom Field tips in one place!
    Thanks!

    1
  5. 5

    What a coincidence! I’ve been working on a WP based project where my client wants to set a different background for each post. I did some research about it and found nothing as helpful as the method you explained here under “Set a different background for each post with custom fields”.

    Thanks a lot! Really appreciate your work.

    1
  6. 6

    Jean-Baptiste Jung

    April 29, 2010 6:34 am

    Amazing post Alex, congrats!

    1
  7. 7

    Custom fields make WordPress seem a lot like MODx. That’s a good thing as long as the product keeps its focus.

    0
  8. 8

    Custom field is one of the most powerful ability of WordPress. I think, to use custom field in a better way, we should create and use custom meta box. I’ve written an article to guide to create a better meta box for WP, hope it’s useful for everybody.

    1
  9. 9

    Amazing Post!!! WordPress Rulez

    0
    • 10

      Thank you for your great plug-in.I have a problem.I use some same named field keys on snlige post.ex.)key=lib value=LibAkey=lib value=LibBkey=lib value=LibCkey=date value=11/20/2007key=publisher value=PubXThen, activated this plug-in using following conf.ini[lib]type = textfield, size = 20[date]type = textfield, size = 20[publisher]type = textfield, size = 20When editing above post, this plug-in’s GUI showed just one lib key and LibA value.After updated the post, lib – LibB and lib – LibC was gone. Could I use same named keys? Is it a matter of conf.ini description?

      0
  10. 11

    I’ve been looking for a little more info on custom fields, thanks.

    0
  11. 12

    That’s some useful info and several of which I’ve actually had some need of in the past. Definitely and article to keep on hand. Thanks!

    0
  12. 13

    Really awesome post Alex,
    Thanks for sharing this useful information.

    0
    • 14

      Hi there,I made a very small modification (added 2 lines of code) to get this pluign to look much nicier in wordpress 2.5It nows looks exactly like the other boxes in the post page, wich you can expand or hide Its beautiful.Please let me know if you want it. By the way, its a good ideia to publish this pluign in the wordpress.org/extend/pluigns directorycheers and thanksLeo,,

      0
  13. 15

    WordPress 3.0, which will be out soon, brings more custom stuff. For example, custom post types:
    http://changingway.org/2010/04/19/wordpress-3-0-custom-post-types/

    0
  14. 16

    Excellent stuff, I find folks don’t use custom fields enough!

    1
  15. 17

    I’m kinda new developing WordPress Themes, the only ones I’ve created is the Theme on my Blog Paintbits and a new project I’m creating where I’m also designing from scratch a functional WordPress theme.

    From what “I got so far” you need to manually add a value each time you write a new post/article, for that sense I think there are better solutions compared to using Custom Fields. I can give you an example, you referred the use of Custom Fields to create Post Types, well with Taxonomies in WordPress you can do the same but being able to achieve a better interface for it since you can use a Admin Panel like Post Tags for your Post Types.

    But yes, there are lots of things you can do with Custom Types, again maybe it’s because I’m still fairly new developing themes, but I haven’t found the need for it outside of what WordPress can do already by other means. :)

    Great post by the way!

    0
  16. 18

    Nikola Lazarevic

    April 29, 2010 7:26 am

    This is excellent post, thanks for superb tips and tricks!

    0
  17. 19

    Customs fields are valuable and perfect for many purposes. However, unless i have not got into these enough – wouldn’t it be great if you could force these to be always visible – i.e. define “title_color” to always be a field that needs to be filled in and is always rpesent on the entry page, not having to be manually added each time. Wouldn’t it be great if custom fields had the ability to be more than text fields – a colour picker for example in the above. etc…
    Or am i really missing how much further this has progressed since my last checks?

    0
  18. 20

    Wow, amazing information. I can’t wait to put the idea for custom post backgrounds in place. You should have called that tip “How to make a blog post look like Zune’s Now Playing view” :)

    0
  19. 21

    thanks Alex For sharing useful information like this..its really inspired me..

    0
  20. 22

    Nice post ! I use custom fields for most of my projects :)

    0
  21. 23

    WordPress 3.0 even has datatypes, so you’re not stuck with just posts and pages anymore. Endless possibilities =D

    0
  22. 24

    Great tips! I’m going to add “Spicing Up Post Titles” to my “development framework”.

    0
  23. 25

    Thanks for the really great info, I’ve always wondered about that section of the Post creation panel.

    1
  24. 26

    Does anyone know how to preset custom fields?
    I use a lot of them, but sometimes just need to reapply the same fields than the previous post. How would you do to preset them?

    The complete explanation and reasoning behind is already explained here:
    http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-112515
    http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-112522

    Does anybody have an idea?
    Would be a real life saver for me…

    0
  25. 27

    Great post. Always knew I should be using these more.

    0
  26. 28

    Oh man, custom fields is where it’s at! The last few themes I’ve made were pretty much entirely based around custom fields. They are a great way to handle conditions in WordPress per post, assuming you have a little extra PHP ability.

    I commonly use fields for specifying paths to media, like MP3s. That way I can choose where to display the players on the page rather than always embedding them in the post. And that way when I switch designs, I’m still in control.

    Custom fields are overlooked a lot, I’m guessing. Definitely something everyone should check out.

    0
  27. 29

    Great tips here. You can really extend the custom fields interface with the amazing Custom Fields Template plugin:

    http://wordpress.org/extend/plugins/custom-field-template/

    0
  28. 30

    Nice list. Custom fields are very powerful.

    Here’s a quick and easy way to use Category custom fields also: http://www.iamseo.org/wordpress/custom-fields-for-categories-wordpress/

    0
  29. 31

    This is such useful information — I sincerely appreciate the time you spent to write this up. I even saved it in Evernote :)

    0
  30. 32

    Great post! Custom fields work wonders. WordPress 3.0 will be unleashing custom content types. Its like custom fields on steroids. WP is definitely starting to look more and more like a full blown CMS.

    We heart WordPress

    0
  31. 33

    Awesome info thanks! I have used a hack using custom fields to link thumbnails of a next gen gallery to specific blog posts on my site. This was not possible using just the next gen gallery plugin. It allowed me to create a ‘gallery & portfolio’ page for all my photographs.

    Thanks, Adam.

    0
    • 34

      I was looking for such thing could you tell me more how you managed to link the nextGen gallery images to a custom field

      0
  32. 35

    Can anyone point me or tell me how to create recent/similar posts in thumbnails using Custom Fields? Is it achievable or done using a different method?
    I am looking for something that they did at mocoloco.com.
    Thnx.

    0
  33. 36

    Would love to see the ability to have custom fields actually populate the post itself – or at least specify that they get included in rss feeds.

    0
  34. 37

    Haaa! (From the main image) Where did the Rogue River, Oregon come from? I’m from around there…

    0
  35. 38

    I use a lot of custom fields in all of my WordPress themes. Has been VERY huelpful in extending the basic functionality of WordPress without installing any plugins.

    0
  36. 39

    I love great job in this post is a good thema very practical

    0
  37. 40

    could something like this be used to allow public users to submit events for moderation? or know of anything?

    0
  38. 42

    Great post…very helpful!

    0
    • 43

      Ryan, This plugin was alrdaey outdated long before Custom Post Types was introduced. There are plenty clones of this plugin that are compatible with latest WP.Please search or post on the WP’s forum or IRC for recommendation. The other plugins should be compatible with mine (provided the authors code them properly) and you don’t lose your data or have to migrate the data.

      0
  39. 44

    Fantastic post, thanks for the great info…

    0
  40. 45

    Nice, very useful.

    0
  41. 46

    Thanks for this great post. Informative and easy to understand.

    0
  42. 47

    This is a great post. Lately, I have been using custom fields for “Members Only” content where I check if the post has a field of “Private” set on it and then have the user log in to see it. I exclusively use WordPress as a CMS for my smaller clients so I rely heavily on the custom fields. Keep up the good work.

    0
  43. 48

    That’s exactly what I was looking for… saves me time – huge thanks!

    0
  44. 49

    That’s exactly what I was looking for… saves me time – huge thanks!

    0
  45. 50

    Thanx for the roundup. I use custom fields for a lot. Mostly for preview images of posts. Since 2.9.2 we can use the new feature post_thumbnail for that. But still i love the custom fields. They make my life much more easy.

    0
  46. 51

    Excellent article, it was very helpful. Cheers Ted

    0
  47. 52

    reminds me of modx too, although in modx you don’t need to use any php. Custom WordPress sites look hard to implement… i will stick with modx thanks…..

    0
  48. 53

    Great article, I will definitely be using some these to make our customers wordpress sites even better.

    It’s also given me some great ideas for future projects, thanks Alex!

    Liam

    0
  49. 54

    This stretched my thinking in the way I approached custom fields. Thanks for the brain shake.

    0
  50. 55

    Good post. Didn’t know wordpress has these features built in. We used PODS for quite a while now and it really makes WP a great CMS for small/medium website. Still, these custom fields techniques can help on some particular requirements.

    0
  51. 56

    Great post Alex…thanks!

    0
  52. 57

    This is a great post. Really informative and giving WordPress the opportunity to become a fully fledged CMS.

    If you want a plug-in i would seriously recommend Custom Field Template. Really easy to use and gives you endless possibilities to create a full CMS WordPress site.

    0
  53. 59

    Kathryn Merlihan

    May 1, 2010 9:54 am

    Thanks for posting! This takes wordpress to a whole new level. Cheers

    0
  54. 60

    …. a fantastic source of dealing with custom fields in WordPress…. making it work for you…. and helping in customizing your WP blog to suit your individual needs !!

    1
  55. 61

    Very useful tip for wordpress coders like me :-)

    0
  56. 62

    few weeks a go i was re-watching elliot stocks videos on how to create a portfolio using wp and he spoke a bit about the customising fields and how they can be used for images and portfolio work discrimption, though i found it abit confusing to follow (as that was not the main point of the video),

    however, this article is fantastic, thanks

    0
  57. 63

    thanks. well said :)

    0
  58. 64

    Thx! I was always editing source of admin and templates to add my own new fields. Now I see that it is easier a lot.

    0
  59. 65

    I second the call for using Pods CMS. It is a lifesaver and a must if you are going to allow a client in to the blog once you are finished with it.

    Pods CMS

    0
  60. 66

    Very very good article. Thanks.

    0
  61. 67

    There are a couple of plugins that make extending WP with custom fields even easier for developers. I’ve used Custom Field Templates on a few projects with good results.

    0
  62. 68

    I am going to go against the grain here a little.

    For me, customfields highlight a gap in the application framework for not being able to effectively add new data types freely.

    It seems almost like a lazy interim idea before the introduction of plug-in’s.

    I think if the Admin management section was a little stronger like Drupal’s for example it would make more sense.

    0
  63. 69

    Good introduction to custom fields both for beginners and intermediates. One thing I missed though was a mention of the upcoming support for custom post-types in WordPress 3.0.

    Custom-post types extends the custom fields functionality and allows you to create completely new taxonomies with their own create and edit screens directly in your WP admin interface. While some of this is already possible by leveraging custom fields you’d often need to expand the DB or use plugins like Flutter or Pods CMS to get similar functionality. Typically with mixed results.

    Whilst custom fields are pretty awesome and very flexible they are also a bit fiddly to use for the average user. It’s fine for your own website but trying to use them to any greater extent for client websites is normally a bit too difficult or clunky for novice users. E.g. upload an image, copy the url and paste that into field x just isn’t that user friendly.

    I’m really looking forward to seeing what custom post types will bring to the table especially with the possibilities to create our own “create/edit” screens.

    0
  64. 70

    @LifeonLars – do you think this custom-post types extension will cover some of the issues encountered with not having an admin interface that allows for the entry of more data types to a post/page?

    0
  65. 71

    Thanks Alex. Solid post. I learned well.

    0
  66. 72

    Very impressed with this post. Not only helped with what I was looking to do with custom fields, but gave me a ton more ideas.

    0
  67. 73

    bam. i just got twice as good at wordpress.
    thanks!

    -1
  68. 74

    JUST AMAZING!!!!

    0
  69. 75

    Awesome blog I actually to run a blog myself. One of my most successful pages is one similar to this one and i stumbled upon it when searching via Google .

    0
  70. 76

    Great post. Even though my blog is growing, I did not know what the custom fields were for. This should take it to a new level. Thanks for the info, including the added links for seo.

    0
  71. 77

    First class post – explaining very clearly, exactly what I needed to change my Title Tags and Descriptions. – Thanks

    0
  72. 78

    Hi,

    A bit of a newbie to custom fields in wordpress and find myself needing some assistance. What i am trying to do is replace a value in a custom field with an image in the post.

    The purpose is to add for example the value “4″ to a rating key for it to then be displayed as a 4 star rating image in the post. I have been able to get it to work showing the value but for some reason it won’t show the image.

    Daniel

    -1
  73. 79

    Hey Smashing Mag

    You might want to have a look at: http://wordpress.org/extend/plugins/advanced-custom-fields/

    Pretty sweet plugin that uses custom fields to re design the edit pages of wordpress.
    Hope you enoy it!

    0
  74. 80

    Using Custom Fields To Create A Unique Design

    Second bit doesnt make any sense to me were do i add the code to the div html on the post or page or in single.php

    0
  75. 81

    I would really like to take the post images on the homepage: faberunashop.com and redirect them to an external link. How do I do this?

    0
    • 82

      HI there. I liked what I read here, very good and the blog is quite uufsel. Continue so. I also invite you visiting my blog, is about several good news and opportunities for business, marketplace, social network, recreation. Here we all can find what we need more uufsell. I know you’ll like it.

      0
  76. 83

    Hi Alex,
    Just wanted to know if there’s a way to make the fields for for the SEO aspect of this tutorial to display by default to make it even more easier for the client. Most Clients hardly get around the UI let alone client a custom field on their own.

    Thanks

    1

↑ Back to top