Completely agree with you John.
And this https://github.com/kenwheeler/slick/issues/4130. looks promising…
Thanks again for your responses,
Dan
Thanks John for weighing in.
I’m worried that slick might be deprecated and then I’ll need to replace it on the sites.
Looking for a carousel that is still in development and maintenance.
Slick, owl and some others haven’t ben updated in 4-6 years.
Who is the new rising star of carousels? 🙂
Even Tiny-slider (based on owl) hasn’t been updated in a while – https://github.com/ganlanyuan/tiny-slider
I’m bumping this topic since I still have my original question form October did not get a reply.
How could I have a page with Flexible content blocks but also have a geutenberg block area?
If not part of the ACF fields, is the only way to add ‘the_content’ area either under or above the flexible content fields in the page template?
Thanks!
Dan
Thank you John, I will try that out.
Dan
Thanks John, I’ll shift to the foreach loop and try to solve based on your suggestion.
Don’t know why, but for me the ‘hav_rows’ loop has always been easier to implement.
Dan
Thanks John, however, if I added a variable within the loop that would take the next slide’s title and save it and then disaplay it outside the loop, wouldn’t that work?
Question is – how do I get the next slide’s title.
Thanks
Dan
A thought about ACF and Gutenberg:
Site creators and editors (not specifically developers) are using ACF for creating backend fields. I often see questions about the last step in the process – either setting up the php template or creating a block for displaying the ACF content in the front end. Which brought me to the thought of a multi-use/dynamic ACF GB block that can display the content of the ACF fields in the front end without the need for coding a GB block or a PHP template.
This would be a native ACF block, bundled as part of the plugin. The user, after creating the ACF fields in the ACF admin would then populate the content in the editor screen and then open up the ACF GB block from withing the block editor, select from a dropdown the field he wants to display and that’s it – the content would be shown on the page. No need to create a php template or a custom block. One block can display any ACF created content.
For each element in the ACF GB block there will be the core GB controls (color, size, alignment etc…). These are pretty raw thoughts, I’m sure they can be improved.
Does this make sense? Has this been created already?
Here is a sketched flow of the process.
Image here:
https://imgur.com/4gGh5ro
For me, I wanted to show the label of the layout and also to show a specific title(based on a custom field – ‘section_title’), so I commented out the
$title = '';
added a dash between the name of the layout and it’s description :
// $title = '';
// load text sub field
if( $text = get_sub_field('section_title') ) {
$title .= '<span> - ' . $text . '</span>';
}
// return
return $title;
}
Hi John, thanks for our reply.
Will be looking forward to 5.8
Dan
is your custom field date picker called “post_date” – because that is a WP parameter. (better off using a different name)
Also, the orderby for a custom field should be:
'orderby' =>'meta_value_num'
Take a look here:
https://www.advancedcustomfields.com/resources/date-picker/
Dan
Hi @willryanuk
I am also having this issue with a school website, listing teachers on a page.
I currently have 75 teachers each with Name, Role, Picture, Email, Phone fields and each update can cause a timeout. It’s on a dedicated server so that’s why I think maybe some code optimization can help.
This is the code I’m using, maybe you can find something not being optimised?
<!-- /////////// Staff /////////////// -->
<?php
// check for rows (parent repeater)
if( get_field('staff') ): ?>
<div id="staff">
<?php
// loop through rows (parent repeater)
while( has_sub_field('staff') ): ?>
<div class="section">
<h3><?php the_sub_field('title'); ?></h3>
<?php
// check for rows (sub repeater)
if( get_sub_field('items') ): ?>
<?php
// loop through rows (sub repeater)
while( has_sub_field('items') ):
// display each item as a list - with a class of completed ( if completed )
?>
<div class="item">
<div class="portrait">
<?php $image = wp_get_attachment_image_src( get_sub_field('image'), 'staff-portrait' ); ?>
<?php if (get_sub_field('image')): ?>
<img src="<?php echo $image[0];?>" alt="<?php echo get_the_title(get_sub_field('image'))?>" />
<?php endif; ?>
</div>
<div class="data">
<h4 ><?php the_sub_field('name'); ?></h4>
<span><?php the_sub_field('role'); ?></span>
<?php if (get_sub_field('email')) : ?>
<span><a href="mailto:<?php the_sub_field('email'); ?>">שליחת מייל</a></span>
<?php endif;?>
<span><?php the_sub_field('phone'); ?></span>
</div>
</div>
<?php endwhile; ?>
<?php endif; //if( get_sub_field('items') ): ?>
</div>
<?php endwhile; // while( has_sub_field('staff') ): ?>
</div>
<?php endif; // if( get_field('staff') ): ?>
<!-- /////////// End Staff /////////////// -->
Dan
Saw this post and it helped me with my shortcode for a repeater field, so I thought I’d post the code I used:
// Box Navigation shortcode
function boxnavf($atts) {
ob_start();
echo '<div class="box-navigation" > ';
if( get_field('box-navigation') ):
echo ' <ul class="boxes">';
while( has_sub_field('box-navigation') ):
echo '<li class="item">';
echo '<a href='.get_sub_field("box-link").'>' .get_sub_field("box-page-name"). '</a>';
echo '</li> ';
endwhile;
echo '</ul/>';
endif;
echo '</div>';
$output = ob_get_clean();
return $output;
}
add_shortcode('boxnav', 'boxnavf');
Thanks
Dan
I was told by support that the cause of this might be because of the counter being inside the acf loop
How can I remove the counter from the loop and still have it function for the lightboxes to work?
Thanks
Dan
The URL of the ACF page has changed to this:
edit.php?post_type=acf-field-group
So updating the function will make it work again:
function remove_acf_menu(){
global $current_user;
if ($current_user->user_login!='admin'){
remove_menu_page( 'edit.php?post_type=acf-field-group' );
}
}
add_action( 'admin_menu', 'remove_acf_menu', 100 );
And just a general tip – please do no use “Admin” as the admin username of your wordpress site. It’s a security thing…
Hi
I am also having this issue.
Could it be related to RTL sites?
Dan
This happens to me too.
Dan
Hi Elliot,
any ideas on these issues?
thanks
Dan
Hi Elliot
Did you have a chance to take a look?
In the same issue, is there a problem having 50 items on a page (created by a repeater field), and in each item 5-6 fields? It takes a long time for the admin page which holds all these fields to load.
Thanks
Dan
Hi Elliot,
Any updates regarding this issue?
Thanks in advance,
Dan
Hi Elliot,
Did you have a chance to take a look?
Thanks
Dan
Hi Elliot,
Yes, after the activation the database was upgraded.
All the fields appear in the field groups when editing the field groups.
When I add a completely new field it does appear in the page edit meta field.
Only the existing fields prior to the acf pro upgrade do not appear – which are a lot of fields…
Thanks
Dan
Thanks Elliot,
That’s a bit out of my scope,
I’ll see if I can solve it in a different way
Dan
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.