Using Simple Fields

Pär Thernström has made Simple Fields – an insanely good plugin for WordPress that extends the functionality of WordPress significantly. With the help of this plugin and the new Custom post type system introduced in WP3, you can finally use WP as a pretty complete CMS.

In this blog post I will show you how to use Simple Fields. In order for not only Swedes to understand, I will comment below in English.

English:

So, this is my little code example getting images with the Simple Fields plugin. This could easily be adapted to be used together with some nice javascript slideshow, enabling slideshows on a per-post basis – very useful, especially together with custom post types.

$selected_value = simple_fields_get_post_group_values(get_the_id(), "Hook-name", false, 2); // make a multidimensional array with values. Hook-name is the name of the hook created with Simple-Fields
 
for ($k = 0; $k "); } // if there is a picture selected, show that image. If there is no image, use the fallback image.
printf("
$description1
"); // print description if ($image2 != "0") { echo wp_get_attachment_image( $image2, $size='medium',$icon = false ); } else { printf("$description2"); } printf("
$description1
"); } // loop ends here. // enable for debugging // print("
");
// print_r($selected_value);
// print("
");

Loading