ACF checkbox array is returning numbers, not labels [closed]

ACF is actually doing what it should – storing a numerical array of selected values. If you want the label you can levy get_field_object, which returns information about the custom field (rather than the value of it for the given post). $field_obj = get_field_object( ‘nav_widget_platforms’ ); $platforms = get_field( ‘nav_widget_platforms’ ); foreach ( $platforms as … Read more

Random images with no duplicates (ACF Gallery) [closed]

Use array_unique() before foreach: Edited: <?php while ( have_posts() ) : the_post(); $images = get_field(‘gallery’); // thumbnail if( $images ): ?> <ul id=”container” class=”tiles-wrap animated”> <?php $images = array_rand($images); $images = array_unique($images); foreach( $images as $image ): // $rand_class = array(‘small’, ‘medium’, ‘large’); $size=”medium”; $thumb = $image[‘sizes’][ $size ]; $width = $image[‘sizes’][ $size . ‘-width’ … Read more

How can you query posts by advance custom field when the value is a serialized array? [closed]

I would advise using the built-in ACF functions for this. Elliot has provided a full toolbox for you and documentation for all field types: <?php // Conditional statement (Single Value) if(get_field(‘page_layout’) == “col_1”) { //… } //Conditional statement (Multiple Values) if( in_array( ‘col_1’, get_field(‘page_layout’) ) ) { //… } ?> Check out the ACF documentation: … Read more

Help using acf/save_post hook to connect to Untappd API and update_field [closed]

It’s because your require_once ‘Pintlabs/Service/Untappd.php’; is relative to “current” file and should be absolute path. I don’t know where are you using this hook but depending on location it should look something like this: ABSPATH is your wordpress root dir and ‘custom-path’ should be a path to Pintlabs dir require_once ABSPATH.’custom-path/’.’Pintlabs/Service/Untappd.php’; get_template_directory() if you use … Read more

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