PHP Puzzle: Unique Styles with PHP loop

To are still call database inside the by get_post_meta() where you already have the values in $custom_fields variable. Try something like this: <?php $custom_fields = get_post_custom($post->ID); for ($i = 1; $i <= 4; $i++) { if(isset($custom_fields[“rw_location_$i”][0])){ if($i==1){ echo ‘<h1>’;} else {echo ‘<h2>’;} echo $custom_fields[“rw_location_$i”][0] if($i==1) {echo ‘</h1>’; }else {echo ‘</h2>’}; } } ?> If I … Read more

Taxonomy Extra Meta [duplicate]

You should be able to do something like this: add_action(“manage_posts_custom_column”, “my_custom_columns”); add_filter(“manage_edit-[POSTTYPE]_columns”, “my_new_columns”); function my_new_columns($columns) { $columns = array( “image” => “Image” ); return $columns; } function my_custom_columns($column) { global $post; if (“ID” == $column) echo $post->ID; elseif (“image” == $column) echo ‘default_value’; } Then you should be able to use $tax_term->image to show it. … Read more

Metabox doesn’t retain values

Many of the comments below refer to code used for debugging, which for clarity I’ve removed. I should have spotted this soon – you are adding only one row into the postmeta table, and that row has the key _my_meta. Before inserting the array int the table, WordPress serializes the array. When you retrieve the … Read more