display Flexible Fields from options

According to ACF Docs on Get values from an options page. You should use ‘option’ not ‘options’ as the second parameter to the have_rows() function. <?php if( have_rows(‘repeater’, ‘option’) ): ?> <ul> <?php while( have_rows(‘repeater’, ‘option’) ): the_row(); ?> <li><?php the_sub_field(‘title’); ?></li> <?php endwhile; ?> </ul> <?php endif; ?>

Advanced Custom Fields Show After Password [closed]

Reading the docs (never used flexible fields, only repeater fields, but look the same): <?php // check if the flexible content field has rows of data if( have_rows(‘flexible_content_field_name’) ): // loop through the rows of data while ( have_rows(‘flexible_content_field_name’) ) : the_row(); if( get_row_layout() == ‘paragraph’ ): the_sub_field(‘text’); elseif( get_row_layout() == ‘download’ ): $file = … Read more

ACF iterating past the while-loop, defining a max number to loop

If I compare the counter to five instead of the input (****), then it evaluates perfectly. Thanks to Milo for the help. <?php if( have_rows(‘program_skills’) ) : while( have_rows(‘program_skills’) ) : the_row(); ?> <div class=”skills-wrapper”> <div class=”col-xs-6″> <p><?php the_sub_field(‘heading’); ?></p> </div> <div class=”col-xs-6″> <div class=”skills-graph”> <ul> ****<?php for($i=1; $i<=5; $i+=1) if( $i <= get_sub_field(‘rating’) ) … Read more

Page returning ID from array, how to return the correct values for post in acf wordpress

I played with the code for a bit longer and managed to get it working. Answer below add_filter( ‘gform_pre_render’, ‘freetrial_studios’ ); add_filter( ‘gform_pre_validation’, ‘freetrial_studios’ ); add_filter( ‘gform_pre_submission_filter’, ‘freetrial_studios’ ); add_filter( ‘gform_admin_pre_render’, ‘freetrial_studios’ ); function freetrial_studios( $form ) { foreach ( $form[‘fields’] as &$field ) { if ( $field->type != ‘select’ || strpos( $field->cssClass, ‘studio-list’ ) … Read more

Advanced Custom Fields Query with Different Values of the Same Key

One option is to fetch all of the posts to a single array and filter that array 50 ways. This would only generate the one query: $posts = get_posts(array( ‘posts_per_page’ => -1, ‘post_type’ => ‘school’ )); To filter your array you would do something like this: $this_state = “Texas”; $state_posts = array_filter($posts, function($results) use($this_state) { … Read more

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