Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter juicyart

    (@juicyart)

    will that show the key name & key value the way it shows when I just use the_meta? Or does it just show the value of the key?

    You can just add the key name yourself inside the template or is it a different keys on different posts?
    The code i posted is just retrieving the value, there’s probably one to get the name also but not sure of what it is.

    ukickarse

    (@ukickarse)

    There’s probably a better way to do this, but here’s something I came up with. Hope this helps.

    Replace <?php the_meta(); ?> with this:

    <ul>
    <?php
      $custom_fields = get_post_custom($post->ID);
      $custom_field_keys = get_post_custom_keys();
      foreach ( $custom_field_keys as $key => $name ) {
        $valuet = trim($name);
    	if ( '_' == $valuet{0} ){
    		continue;
    	}
    	if ($name != "ratings_users" && $name != "ratings_score" && $name != "ratings_average"){
    		echo "<li>";
    		echo "<strong>" . $name . ":</strong> ";
    		$my_custom_field = $custom_fields[$name];
    		foreach ( $my_custom_field as $key => $value )
    			echo $value . "</li>";
    	}
      }
    ?>
    </ul>

    Thanks for that code ukickarse, I was having this same problem and it works ??

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘[Plugin: WP-PostRatings] How to remove custom fields?’ is closed to new replies.