advanced-custom-fields

Can anyone spot why my Wordpress loop breaks all the Advanced Custom Fields code that comes after it?

£可爱£侵袭症+ 提交于 2020-01-05 07:29:16
问题 The following loop is running successfully and shows no syntax error in my editor, but it's breaking only the Advanced Custom Fields PHP that comes after it (all the ACF before it works fine, and everything after except ACF works fine). <?php $args=array( 'post_type' => 'page', 'post_parent' => '39' ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="project" style="background-image:url('<?php the_field(

Jquery isotope filtering fade unmatched items instead of hiding

﹥>﹥吖頭↗ 提交于 2020-01-03 04:32:05
问题 Jquery isotope filtering fade unmatched items instead of hiding. in case of filtering the unmatched items get the property of display none. I want to show the match items should automatically scroll up and other should scroll down something like this http://base22.com/wps/portal/home/about-us/our-team var $container = $('.portfolioContainer'); $container.isotope({ filter: '*', hiddenStyle: {opacity: 0.7}, visibleStyle: {opacity: 1}, animationOptions: { duration: 750, easing: 'linear', queue:

How to get real term_meta using ACF with custom fields on taxonomy terms (instead of wp_options)

谁说我不能喝 提交于 2020-01-03 03:46:06
问题 Having a simple Woocommerce site, I'm using ACF pro to add some custom fields to the terms of a given taxonomy. Using this, I can, for example, add a "color" field to my "product category" taxonomy terms. Good. The issue: Wanting to do some query using get_terms() (codex), I discovered that my meta_query parameters were not working (unexpected results). Why ? My custom fields were not saved (from backend) as term_meta but as wp_option . It seems that ACF 4 is saving those fields, not as term

Wordpress ACF get_field( ) not returning value

一曲冷凌霜 提交于 2020-01-02 03:27:46
问题 I am using the advanced custom field plugin for Wordpress . I am having difficulty displaying a field on my page. Basically I've created a field group and assigned id's to the members of that group. I then use the get_field('field_name') function to store the value of this field in a variable and echo it on the screen. However this is returning false . I've also tried using the_field('field_name') but this returns null . I then read somewhere If you are trying to access a field outside of the

Adding a character in the middle of a string

不打扰是莪最后的温柔 提交于 2020-01-02 01:11:14
问题 There's probably a simple solution to this that will cause a facepalm. I have time stored as a 4 character long string ie 1300. I'm trying to display that string as 13:00. I feel like there has to be a solution to this that is more elegant than what I'm doing at the moment. I currently have: $startTime = get_field($dayStart, $post->ID); $endTime = get_field($dayEnd, $post->ID); for ($x=0; $x = 4; $x++){ if(x == 2){ $ST .= ':'; $ET .= ':'; } else { $ST .= $startTime[x]; $ET .= $endTime[x]; } }

Add Advanced Custom Fields to WooCommerce Product Variation

家住魔仙堡 提交于 2019-12-31 03:59:13
问题 I am using plugins called Advanced Custom Fields (ACF) and WooCommerce. I want to create a text and image field for WooCommerce product variation. I created fields in ACF and assigned them to "Post Type" > "product_variation" . But for I don't see these fields under product > Variations . I searched and it looks like I have to write a custom code to accommodate these fields. I tried searching the problem and most of the suggestions and tutorials I founds are about creating custom fields via

Show most recent post - if “yes” chosen as radio button value

本秂侑毒 提交于 2019-12-25 18:47:07
问题 Here is the setup for my radio button: I can't seem to get the posts that are valued at yes to display in the loop.. Here is my loop: <?php $args = array( 'numberposts' => 1, 'post_type' => 'event', 'posts_per_page' => '1', 'meta_key' => 'sponsored_event', 'meta_value' => 'yes' ); $the_query = new WP_Query( $args ); ?> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <div class="sponsored-event"> <div class="sponsored-image" style="background-image:

A complicated query combining a WP Courseware function, ACF repeater fields and a meta_query looking for a particular template file

浪尽此生 提交于 2019-12-25 06:27:51
问题 I have a pretty complicated query that I have not been able to get to work the way I need it to. I have a Wordpress install using the plugins WP Courseware and ACF. I need to display a page of courses associated with the current user. I want the links to lead the user to the course "home" pages that the user should hit prior to starting the course. I have created course "home" pages, but the problem is WP Courseware has no way to associate a page with a course. So I had to use an ACF options

A complicated query combining a WP Courseware function, ACF repeater fields and a meta_query looking for a particular template file

拥有回忆 提交于 2019-12-25 06:27:24
问题 I have a pretty complicated query that I have not been able to get to work the way I need it to. I have a Wordpress install using the plugins WP Courseware and ACF. I need to display a page of courses associated with the current user. I want the links to lead the user to the course "home" pages that the user should hit prior to starting the course. I have created course "home" pages, but the problem is WP Courseware has no way to associate a page with a course. So I had to use an ACF options

Pulling in image from custom taxonomy with ACF

爷,独闯天下 提交于 2019-12-25 02:57:40
问题 So here is what i'm trying to do. I have created a custom taxonomy called "country" and within that custom taxonomy I have categories of different countries like, USA, France, Germany, England and so on. I created a ACF(Advance custom field) Field Group that lets me add a image to each country, I have this called "flag". So when I make a post and I check the country under the custom taxonomy I need to pull that image (flag) associated with that category and display it on my page. I have seen