This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if( have_rows('main_flexible_field') ): ?> | |
| <!-- working from the main flexible content loop --> | |
| <?php while ( have_rows('main_flexible_field') ) : the_row(); ?> | |
| <!-- working inside the nested flex field --> | |
| <?php while(has_sub_field("nested_flex_field")): | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class craft_child_features { | |
| static function setup() { | |
| add_filter( 'craft_acf_parent_features', __CLASS__ . '::craft_child_remove_acf_groups' ); | |
| } | |
| /** | |
| * [craft_child_remove_acf_groups description] | |
| * @param [type] $features [description] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="my-class"> | |
| <?php | |
| //get the shortcode value as a string. | |
| $slider = get_field('field_name'); | |
| echo do_shortcode( $slider ); | |
| ?> | |
| </div> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if( function_exists('acf_add_local_field_group') ): | |
| acf_add_local_field_group(array ( | |
| 'key' => 'group_5874cab2516b6', | |
| 'title' => 'Quiz', | |
| 'fields' => array ( | |
| array ( | |
| 'layouts' => array ( | |
| array ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while ( have_posts() ) { the_post(); | |
| if( have_rows('quiz') ): | |
| while ( have_rows('quiz') ) : the_row(); | |
| if( get_row_layout() == 'single_choice' ): | |
| the_sub_field('question'); | |
| endif; | |
| endwhile; | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //add this piece of into your template file | |
| global $post; | |
| echo $post->ID;//check to verify the global post ID is correct. | |
| //try to return the ACF value using get_field/the_field | |
| the_field('field_name'); | |
| $value = get_field('field_name'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: My Salon & Spur | |
| Description: For adding Salon and Spur managment features to a website | |
| Author: Patrick N. Mwange | |
| Version: 1.0.0.0 | |
| */ | |
| function my_custom_salons() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Checks to see if "is_plugin_active" function exists and if not load the php file that includes that function */ | |
| if ( ! function_exists( 'is_plugin_active' ) ) { | |
| include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| } | |
| /* Checks to see if the acf pro plugin is activated */ | |
| if ( !is_plugin_active('advanced-custom-fields-pro/acf.php') ) { | |
| /* load the plugin and anything else you want to do */ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if( have_rows('add_career_opportunities', 'option') ): ?> | |
| <div id="career-single"> | |
| <?php while( have_rows('add_career_opportunities', 'option') ): the_row(); | |
| //Variables | |
| $title = get_sub_field('job_title'); | |
| $description = get_sub_field('job_description', 'option'); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //here is the correct way to dequeue the select2 js used by acf | |
| function my_acf_init() { | |
| acf_update_setting('enqueue_select2', false); //this value defaults to true | |
| } | |
| add_action('acf/init', 'my_acf_init'); |