advanced-custom-fields

PHP counter with ACF Flexible fields and Fullpage.js

倖福魔咒の 提交于 2019-12-23 02:19:08
问题 I'm hoping someone can help me... I am using Alvaro Trigo's Fullpage.js and Elliot Condon's ACF Flexible field within a Wordpress site I'm developing. For each flexible field entry I declare a new section / page within Fullpage. The client would like a counter fixed to the bottom of the page, which reads 1/10, 2/10, 3/10 etc. I am able to count the total number of fields, using <?php echo count( get_field('content') ); ?> However, I am unsure how to update each number every time the slide

PHP counter with ACF Flexible fields and Fullpage.js

岁酱吖の 提交于 2019-12-23 02:19:08
问题 I'm hoping someone can help me... I am using Alvaro Trigo's Fullpage.js and Elliot Condon's ACF Flexible field within a Wordpress site I'm developing. For each flexible field entry I declare a new section / page within Fullpage. The client would like a counter fixed to the bottom of the page, which reads 1/10, 2/10, 3/10 etc. I am able to count the total number of fields, using <?php echo count( get_field('content') ); ?> However, I am unsure how to update each number every time the slide

Get advanced custom fields repeater field value based off of another repeater value

怎甘沉沦 提交于 2019-12-23 01:13:45
问题 I have a repeater field on a page, in that field i have a post object field and a few text fields. The post object field just gets the ID of whatever post you set. When i am a single post i want to run a database query that uses the current post ID to find the matching sub field, then get another sub field in that same repeater field. Can anyone help with this? This is what i have so far which is not want i need but its the closes it have been able to get $games_id_array = $wpdb->get_results(

Advanced Custom Fields - Wordpress

吃可爱长大的小学妹 提交于 2019-12-22 10:27:46
问题 While using the Custom Fields Plugin , I cannot get it to return any data. I have created a field group called book_cover_thumbnail which has one post linked to it. Can anyone see why the code below would not work? <img src="<?php get_field('book_cover_thumbnail');?>" /> I get no errors at all, no white space. 回答1: Make sure you are a) Echoing the field using either the_field() or echo get_field() , and b) this code is either within the wordpress loop like this: <?php if ( have_posts() ) :

Output a product custom field in WooCommerce Order Admin Page (ACF)

送分小仙女□ 提交于 2019-12-19 04:43:11
问题 With WooCommerce, I'm using the Advanced Custom Fields plugin to keep a track of where I physically store each product. When an order comes in, I want to be able to look at the admin edit order page and see where the items are stored. So I can grab it to ship. Here's a picture of what I want to see: Hopefully, it makes sense. I just want to recall the individual product ACF variable (BinLocation) for each product on the Edit Order Admin Page for Wordpress. Any help on this? Thanks. 回答1:

Output a product custom field in WooCommerce Order Admin Page (ACF)

旧巷老猫 提交于 2019-12-19 04:43:09
问题 With WooCommerce, I'm using the Advanced Custom Fields plugin to keep a track of where I physically store each product. When an order comes in, I want to be able to look at the admin edit order page and see where the items are stored. So I can grab it to ship. Here's a picture of what I want to see: Hopefully, it makes sense. I just want to recall the individual product ACF variable (BinLocation) for each product on the Edit Order Admin Page for Wordpress. Any help on this? Thanks. 回答1:

Insert PHP code into the Visual Composer

五迷三道 提交于 2019-12-19 04:43:06
问题 I have the php code (ACF Pro plugin code). How can I insert this code into my Visual Composer? Can't find the solution for a long time but now it's critical for me. <?php if( have_rows('add_a_new_table') ): ?> <?php while( have_rows('add_a_new_table') ): the_row(); // vars $t_title = get_sub_field('t_title'); $t_pricing = get_sub_field('t_pricing'); $t_emails_number = get_sub_field('t_emails_number'); ?> <div class="col-sm-12 col-sm-4 text-center"> <div class="courses-column"> <div class=

Wordpress ACF: How to add rows to a repeater field attached to a user via custom code (PHP)

筅森魡賤 提交于 2019-12-18 12:28:08
问题 I have been through the ACF and ACF Repeater Field documentation but it has left me a little bit confused. I have a bunch of users and I have (through ACF) attached a repeater field to each of them (called Events), the repeater field has a sub-field called Event ID (event_id). Now the dilemma I have is that I want to be able to add and remove rows of event_id from the user depending on which events they have tried to add and remove. I know of the update_field($field_key, $value, $post_id)

Change Google Maps marker icon when clicking on other

笑着哭i 提交于 2019-12-17 19:49:20
问题 I have created a Google Maps Multiple locations page, using Advanced Custom Fields Google Map field. I have managed to make the marker icon change when clicked on, but I want it to be changed back when clicking on other icons. here is an example of the code: for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: iconBase + 'Stock%20Index%20Up.png' }); google.maps.event.addListener(marker,

Woocommerce Readonly Billing Fields - Select and Radio Fields

余生颓废 提交于 2019-12-13 20:13:34
问题 I've implemented the solution suggested by @zipkundan like this: add_action('woocommerce_checkout_fields','customization_readonly_billing_fields',10,1); function customization_readonly_billing_fields($checkout_fields){ $current_user = wp_get_current_user();; $user_id = $current_user->ID; foreach ( $checkout_fields['billing'] as $key => $field ){ if($key == 'billing_address_1' || $key == 'billing_address_2' || $key == 'billing_first_name' || $key == 'billing_check_business' || $key == 'billing