Adding class to last list item? Not WP generated

I can only see achieving this by first building an array, then looping over it – I can’t find anything in APC’s docs about checking if it’s the last iteration of the_repeater_field: $images = array(); while ( the_repeater_field( ‘homepage_service’ ) ) $images[] = get_sub_field( ‘service_image’ ); if ( $images ) { $image_last = array_pop( $images … Read more

Website loading slowly – Advanced Custom Fields images

I have managed to work it out – the function was leading to a lot of queries, so I rewrote it as follows: $housePhotos = get_post_custom_values(‘house_photos’); $housePhotos = explode(‘;’,$housePhotos[0]); preg_match_all(‘`”([^”]*)”`’, $housePhotos[1], $results); $imageURL = wp_get_attachment_image_src( $results[1][0], ‘house_search’ ); if (!empty($results[1][0])) { echo ‘<img src=”‘ . $imageURL[0] .'” alt=”” />’; }

Querying posts by latitude and longitude to build a Google Maps with several markers

To connect your meta fields with the “Geo Data Store”-Plugin, you simply take the name of the meta key/field and map it with the filter to the plugin. add_filter( ‘sc_geodatastore_meta_keys’, ‘wpse82502_lat_lng_metakey_mapping’ ); function wpse82502_lat_lng_metakey_mapping( $keys ) { $keys[] = “your_meta_key_field_name”; return $keys; } To get the data from PHP to JS, simply use wp_localize_script().

How can i count the images that are atacht to NextGEN Gallery

Assuming you actually have something in the $gallery object (hint: confirm that by print_r($gallery) in your template), then your code should work. Perhaps step back and leave the database stuff to NextGEN, just count the image IDs: global $nggdb; $poze = get_field(‘poze’); if ($poze && count($poze)) { $galleryID = $poze[0][‘ngg_id’]; $imageIDs = $nggdb->get_ids_from_gallery($galleryID); $count = … Read more