Custom Field values not Showing in Edit Page of Custom Post Type

Whenever in doubt about the functioning of WordPress functions, consult the Codex: http://codex.wordpress.org/Function_Reference/register_post_type There, we can see that when registering a post type the supports argument has many options, one of them custom-fields. So, this would enable the CF box for the CPT: $args = array( ‘labels’ => $labels, ‘public’ => true, ‘publicly_queryable’ => true, … Read more

Vimeo thumbnails

Maybe this can help $videoID = the_field(‘video_link’); $jsonurl=”http://vimeo.com/api/v2/video/”.$videoID.’.json’; $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json,true); echo ‘<img src=”‘. $json_output[0][‘thumbnail_large’] .'” />’; It’s the same call using json method

Advanced Custom Fields functionality without plugin

I am aware of the capability of adding meta boxes for single text fields, etc, but that’s not what I am actually after. Meta fields aren’t just for “single text fields”, the database type is longtext: mysql> DESCRIBE wp_postmeta; +————+———————+——+—–+———+—————-+ | Field | Type | Null | Key | Default | Extra | +————+———————+——+—–+———+—————-+ | … Read more

How do I enforce users to fill a determined custom field using WyPiekacz?

I have no experience with this plugin. But when I look at the source, I think something like this should do it: add_filter( ‘wypiekacz_check_post’, ‘wpse_78395check’ ); function wpse_78395check( $errors ) { if ( empty ( $_POST[‘custom_field_name’] ) ) $errors[] = array ( ‘unique_error_key’, __( ‘Custom error message’, ‘your_textdomain’ ) ); return $errors; } Replace all … Read more

how to make nsfw post with thumbanil

get_post_meta is your friend: if ( has_post_thumbnail() ) { if ( ‘yes’ == get_post_meta( $post->ID, ‘NFSWEG’, true ) ) { echo ‘<img src=”https://wordpress.stackexchange.com/questions/82422/YOUR-IMAGE-HERE”>’; } else { the_post_thumbnail( array( 400, 400, true ), array( “class” => “aligncenter featured_image” ) ); } }

$TBA Getting Translated to $0 (Custom Fields)

The problem is that you’re trying to perform a math operation on a string (‘TBA’) so the result is going to be 0. Try testing if the value is numeric by using the php function is_numeric(). You can see the docs for that function here. So in your code do this: if (is_numeric($price)) { …format … Read more