Can you please explain better how did you solve that? Why did you create a custom endpoint? I’m using the default one of wordpress with acf rest api plugin but doesn’t work. Could you share your complete solution? Thanks in advance
I know it woks but hey shound implement it in ACF!
Same problem here, how to hide content editor in WP 5? ACF options is not working @eliot could you implement this -> https://www.isitwp.com/disable-content-editor-for-specific-page-template/ ?
Understood, i can’t use a template page cause it refers to index.php, i though there should be a way to identify the page that wp refers to “listing posts” but that seems to be not possible. Anyone else has ideas?
Great! This one works! Thank you!
It doesn’t work. I searched online, used Ymd or Y-m-d format but nothing to do:
$eventi = get_posts(array(
'post_type' => 'eventi',
'posts_per_page' => -1,
'meta_key' => 'eve_start_date', //setting the meta_key which will be used to order
'orderby' => 'meta_value', //if the meta_key (population) is numeric use meta_value_num instead
'order' => 'ASC',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'correla_evento_a_struttura', // name of custom field
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
),
array(
'meta_key' => 'eve_start_date',
'type' => 'DATETIME', // You can also try changing it to TIME or DATE if it doesn't work
'meta_value' => current_time("Ymd"),
'meta_compare' => '>='
),
),
));
Uhm, that could be terrible if i have more than 100 🙁 Thanks anyway
Anyone? no field to target specific comment as you can do with post-object or relationship? 🙁
Any news about this functionality in core? Or examples on how to do?
Here we are, I changed flexible field name, (closed a missed query on a template) and it seems to be fixed now…
Hi @acf-support, I send you access to my WP Backend privately, anyway, here’s the JSON of “bug”, please let me know. I don’t have pages with same name as you said. No duplicate, anywhere.
The problem was a bug with WPML 3.3.3, they now fixed it with 3.3.4 version (see attached changelog)
Great! I would be excited to see that functionality implemented into v5 core soon! 🙂 Any plan?
Fixed. Problem was related to long field name
I’m trying to debug. Problem seems to be related only to customized ACF <select> (such as Link to a Page field) and repeater combination. Other fields work
I tried reverting to 5.3.1 but problem persists.
Other integrations: Fields are in a option page. I tried re-creating field ex-novo with same results. Also “select” fields now disappear
Great it works, thank you :)!
Could you specify this point better in documentation? 🙂
<?php $posts=get_field( 'ricette_correlate'); if( $posts ): ?>
<div class="related-ricette">
<ul>
<?php foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
<li>
<a href="<?php echo get_permalink( $p->ID ); ?>">
<?php echo get_the_title( $p->ID ); ?></a>
</li>
<?php endforeach; ?> </ul>
</div>
<!--/.related-ricette-->
<?php endif; ?>
this is inside homepage (created with a custom page tpl, inside the post-type query).
Complete code of custom query:
<?php $args = array(
'post_type' => 'corsi',
'posts_per_page' => 6
);
$the_query = new WP_Query( $args);
// The Loop
if ( $the_query->have_posts() ) : ?>
<div class="listing-corsi">
<div class="col-group-row">
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col one-third m-1-2 s-1-1">
<div class="item-corso" data-mh="grp-item-corso">
<figure class="bwWrapper main-thumb"><?php the_post_thumbnail('t630x364');?></figure>
<div class="entry-content">
<h2 class="entry-title"><?php the_title();?></h2>
<div class="meta">
<div class="date"><?php the_field('data_corso');?> / <?php the_field('orario_corso');?></div>
</div><!--/.meta-->
<div class="entry-text">
<?php the_content();?>
</div><!--/.entry-text-->
<div class="show-related-ricette">
<span class="icon-top-arrow"></span> Ricette correlate al corso
</div><!--/.show-related-ricette-->
<?php
$posts = get_field('ricette_correlate');
if( $posts ): ?>
<div class="related-ricette">
<div class="close"><span class="icon-close"></span></div>
<ul>
<?php foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
<li>
<a href="<?php echo get_permalink( $p->ID ); ?>"><?php echo get_the_title( $p->ID ); ?></a>
</li>
<?php endforeach; ?>
</ul>
</div><!--/.related-ricette-->
<?php endif; ?>
<div class="cat-list">
<?php
global $post;
$terms = wp_get_post_terms( $post->ID , 'tipologia_di_cucina' );
if ( $terms ){
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li><a href="'.get_term_link( $term ).'">' . $term->name . '</a></li>';
}
echo '</ul>';
}
?>
</div><!--/.cat-list-->
</div><!--/.entry-content-->
</div><!--/.item-corso-->
</div><!--/.col-->
<?php endwhile; ?>
</div><!--/.col-group-row-->
</div><!--/.listing-corsi-->
<?php endif; wp_reset_postdata(); ?>
Great it works! Thank you Timothy!
I hope Elliot will put this into documentation 🙂
I found a solution! I hope it will be useful for someone else in future:
function add_date_to_cf7() {
$output = "<select name='date_corso' id='date_corso' onchange='document.getElementById(\"date_corso\").value=this.value;'><option></option>";
if( have_rows('gruppo_date') ) {
while( have_rows('gruppo_date') ) {
the_row();
$output .= '<option value="'.get_sub_field('intervallo_date_corso').'">' .get_sub_field('intervallo_date_corso'). '</option>';
}
}
$output .= "</select>";
return $output;
}
wpcf7_add_shortcode('date_corso', 'add_date_to_cf7', true);
Same issues, 5.2.0, WP 4.4.1
Thank you Elliot, I’ll read it, you’re great! I hope you’ll find a good team to continously support ACF as it deserve 🙂
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.