Here is a video of the issue with duplicated fields:
https://www.dropbox.com/s/9jza7uvp07kvh1x/issue_acf_pro.mov?dl=0
Hi JF,
You can try this one, it should works:
<?php $term = get_field('taxonomy');
if( $term ):
echo $term[0]->name;
endif; ?>
It works, thanks a lot!
Hey Bassapguy,
Have you tried to put your code in 404.php:
<?php the_field('MY_FIELD', XX); ?>
Where XX is your contact field ID?
Hello there!
I wrote a tutorial on my blog about that:
https://www.pushaune.com/blog/tutoriels/comment-recuperer-un-champ-acf-dune-categorie/
If you don’t speak french, here is the answer:
<?php $terms = get_the_terms( get_the_ID(), 'category');
if( !empty($terms) ) {
$term = array_pop($terms);
$custom_field = get_field('image_de_fond_de_categorie', $term );
$custom_field_text = get_field('texte_dintroduction', $term );
?>
<img src="<?php echo $custom_field; ?>"><!-- Afficher l'image de la catégorie -->
<?php echo $custom_field_text; ?><!-- Afficher le texte de la catégorie -->
<?php } ?>
Hello there!
Have you tried someting like:
$var = get_sub_field('MY_SUB_FIELD_SLUG', XXX);
Where XXX is the ID of the Careers page?
I got the same this morning.
You have to increase the limitation on the Google API Panel.
To achieve that, you have to creat a billing account on Google Dev.
Nevermind, I find a way.
Here is my code in case someone would do it:
<?php
$terms = get_field('categories_a_afficher', 'option');
if( $terms ): ?>
<?php foreach( $terms as $term ): ?>
<div class="category_list">
<h2 class="fond">
<?php echo $term->name; ?>
</h2>
<a href="<?php echo get_term_link( $term ); ?>">
<?php _e( 'View all posts from', 'twentyeleven' ); ?> <strong><?php echo $term->name; ?></strong>
</a>
<!-- Here the query begin -->
<?php query_posts( 'showposts=2&order=DSC&cat=' . $term->term_id . ''); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; endif; wp_reset_query(); // On ferme la boucle ?>
<?php //echo $term->term_id; ?>
</div><!-- .category_list -->
<?php endforeach; ?>
<?php endif; ?>
Nevermind, this code just works well.
I had an other text field with the same name. Silly me -_-
Okay, I get it. Sorry I misunderstood the doc -_-
Could be great to get the field’s slug within the loop 🙂
Hey!
Two solutions to make it easier fot the front-end user:
1- open the link in a new tab.
2- put all your files in an archive.
It is a text field, and I get as a result the formatting text field (with accents, caps and spaces).
Hey!
I just did the same for an website I am made.
There are two solutions:
1/ Option
Instead of placing your fileds in the HP, you should creat an option page:
https://www.advancedcustomfields.com/resources/options-page/
That works just fine 🙂
2/ Dynamic #ID based on your language
Place this up the page in your php code :
<?php $pageID = icl_object_id(329, 'page', false); ?>
Change 329 by tyour HP’s ID.
Then, to call the field use this:
<?php the_field('MY_FIELD_NAME_HERE', $pageID); ?>
Even if the second solution works fine, the 1st one is more convenient for the BackEnd user 🙂
Thanks for your reply. It does’nt work but I manage to get these videos an other way.
Anyway, if someone solve this problem it could be interesting 🙂
I foud it in woocommer/loop/rating.php:
<?php if ( $rating_html = $product->get_rating_html() ) : ?>
<?php echo $rating_html; ?>
<?php endif; ?>
Here is an article about it:
https://www.gavick.com/blog/woocommerce-product-layout
Got it!
You have to add this function before rendering the map :
function markerCluster( markers, map ) {
var markerCluster = new MarkerClusterer(map, markers, {imagePath: 'YOURPATHHERE/images/m'});
console.log( markers );
}
Got it!
Here is the solution in case of someone need it 🙂
<?php
// Get all users. you can use the WodPress args to filter them.
$blogusers = get_users( 'blog_id=1&orderby=nicename' );
// Array of WP_User objects.
foreach ( $blogusers as $user ) {
// Creating the var user_ID to use with ACF Pro
$user_id = 'user_'. esc_html( $user->ID );
?>
<?php the_field('EXEMPLE', $user_id); ?>
<?php } ?>
Hi!
Found it! This code was on the function.php and was messing with ACF PRO:
// Connection error
add_filter('login_errors',create_function('$a', "return null;"));
function set_post_order_in_admin( $wp_query ) {
if ( is_admin() ) {
$wp_query->set( 'orderby', 'post_status' );
$wp_query->set( 'order', 'DESC' );
}
}
add_filter('pre_get_posts', 'set_post_order_in_admin' );
I removed it and it works just fine 🙂
I’ve tried to install ACF Pro on an other wordpress website, I have the same issue.
Does anyone had this one?
I’ve tried to create 2 new field at the end of the list, but after saving they are moved to the top:
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.