Populating content dynamically via AJAX and Advanced Custom Fields [closed]

Here is what I ended up doing based on @gdaniel’s suggestion: AJAX call: $(‘.btn’).click(function() { $.ajax({ url:”<?php bloginfo(‘template_directory’); ?>/inc/galleries.php”, type: ‘POST’, data: {postID: ‘<?=$post->ID;?>’, galleryCategory: $(this).attr(“data-content”)}, success: function(resp) { $(‘#photos’).append(resp); } }); }); And here is my PHP file: <?php require(‘../../../../wp-load.php’); $postid = $_POST[‘postID’]; $galcat = $_POST[‘galleryCategory’]; ?> <div class=”photos” id=”$galcat”> <h1><?php echo $galcat; ?> … Read more

Acf Pro repeater field returns null [closed]

I’ve just solved this issue thanks to the Avanced WordPress group in Facebook (https://www.facebook.com/groups/advancedwp/). It was actually a mistake I had made: I had a query before the custom fields and it had to be reset. This is the working snippet: <?php // WP_Query arguments $args = array ( ‘post_type’ => ‘post’, ‘posts_per_page’ => ‘4’, … Read more

ACF – Get lowest & highest value from field

Got it working in the end with the below code: <?php $args = array( ‘posts_per_page’=> -1, ‘post_type’ => ‘properties’, ‘meta_key’ => ‘development’, ‘meta_value’ => $development_id, ); $properties_query = new WP_Query( $args ); $prices = array(); if( $properties_query->have_posts() ): while( $properties_query->have_posts() ) : $properties_query->the_post(); $price = get_field(‘price’); if(isset($price) && !empty($price)){ $prices[] = $price; } endwhile; $max_price … Read more

Last modified field for user profile?

As mentioned in the comments, you can use the Plugin and Metadata APIs to attach some functionality to the ‘profile_update’ action such that whenever a user’s profile information receives an update, custom user-metadata is set to the time of the update: function wpse216609_update_profile_modified( $user_id ) { update_user_meta( $user_id, ‘wpse216609_profile_updated’, current_time( ‘mysql’ ) ); } add_action( … Read more

Sorting custom admin column by value

Ah, the remedy was a simple one: function issue_column_orderby( $vars ) { if ( isset( $vars[‘orderby’] ) && ‘linked_issue_post’ == $vars[‘orderby’] ) { $vars = array_merge( $vars, array( ‘meta_key’ => ‘article_issue_n’, ‘orderby’ => ‘meta_value’ ) ); } return $vars; } add_filter( ‘request’, ‘issue_column_orderby’ ); I probably omitted something before…

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