How to add/edit advanced custom fields on custom post type’s WordPress REST API?

I think the only thing missing here is an update_callback in the call to register_rest_field. register_rest_field( ‘note’, ‘noteLink’, array( ‘get_callback’ => function(){ return get_field(‘page_link’); }, ‘update_callback’ => function( $value, $post ){ update_field(‘field_619dacfd37924’, $value, $post->ID ); } )); An important part of that according to ACF docs is using the field key to update the value … Read more

How do I retrieve an image’s width and height using Advanced Custom Fields?

You can get the ID for the attachment with $attachment_id = get_field(‘field_name’);. When you have the ID you can use wp_get_attachment_metadata() to get the info associated with the image in an array. The images width and height are stored in cells named width and height. $attachment_id = get_field(‘field_name’); $metadata = wp_get_attachment_metadata($attachment_id); $width = $metadata[‘width’]; $height … 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

How to create a page and display only the posts with a specific custom field value?

Duplicate your page.php template, name the duplicate page-facebook.php, give it a template name: /* Template Name: My Facebook Meta Key Page */ More information here: http://codex.wordpress.org/Page_Templates To get the right posts with get_posts use something like this: <?php $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘facebook’, ‘value’ => ‘yes’, ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)