Custom Field 101

I would not use custom fields or shortcodes for this functionality, I would look at filters. the_content filter and the loop_end action (just make sure that your theme uses while ( have_posts() ) in single post pages) comes to immediate mind here. These are two options which requires no modification of any of your files … Read more

Remove the last X characters of a custom field value

You have to consider that you’re dealing with substr() a string related function as the str in the function name indicates. That does mean that the parameter $string you give actually has to be of the type string. get_post_meta() on the other hand does just give you back whatever type you saved in the first … Read more