Hello!
I want to define an array of posts from which I want to get galleries and display them in one page.
I tried it through code acf_post_id="7291, 7297, 7299"
, but it doesn’t work. I can only specify one post ID, but how do I specify an array of posts?
My shortcode:
[ajax_load_more acf_post_id=7291, 7297, 7299″ posts_per_page=”24″ acf=”true” acf_field_type=”gallery” acf_field_name=”coloring_gallery” seo=”true” pause=”true” scroll=”false” transition_container_classes=”row row-cols-2 row-cols-md-4 g-3 g-lg-4 mt-0 itemlist”]
Are there any quick solutions? I tried looking at the plugin code in ajax-load-more-for-acf.php
, but didn’t find anything.
Thank you!
]]>I have WP_DEBUG active on a staging site, and it’s showing the following messages.
Deprecated: Required parameter $field_name follows optional parameter $type in [plugins_directory]/ajax-load-more-for-acf/functions.php on line 14 Deprecated: Required parameter $id follows optional parameter $type in [plugins_directory]/ajax-load-more-for-acf/functions.php on line 14 Deprecated: Required parameter $field_name follows optional parameter $type in [plugins_directory]/ajax-load-more-for-acf/functions.php on line 219 Deprecated: Required parameter $id follows optional parameter $type in [plugins_directory]/ajax-load-more-for-acf/functions.php on line 219 Deprecated: Required parameter $field_name follows optional parameter $parent_field_name in [plugins_directory]/ajax-load-more-for-acf/functions.php on line 282 Deprecated: Required parameter $id follows optional parameter $parent_field_name in [plugins_directory]/ajax-load-more-for-acf/functions.php on line 282 Warning: Cannot modify header information - headers already sent by (output started at [plugins_directory]/ajax-load-more-for-acf/functions.php:14) in [site_directory]/wp-admin/includes/misc.php on line 1381 Warning: Cannot modify header information - headers already sent by (output started at [plugins_directory]/ajax-load-more-for-acf/functions.php:14) in [site_directory]/wp-includes/functions.php on line 6878 Warning: Cannot modify header information - headers already sent by (output started at [plugins_directory]/ajax-load-more-for-acf/functions.php:14) in [site_directory]/wp-admin/admin-header.php on line 9]]>
My shortcode:
[ajax_load_more id="homepage-series" container_type="div" posts_per_page="4" scroll="false" button_label="Show More" repeater="default" orderby=”post__in” acf="true" acf_field_type="relationship" acf_field_name="series"]
My template:
<?php
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(), 'card-rollover');
?>
<div class="col">
<a href="<?php the_permalink(); ?>" class="rollover-card" style="background-image:url('<?php echo $featured_img_url; ?>');">
<div class="inner">
<div>
<span class="top-lines"></span>
<span class="bottom-lines"></span>
<span class="label">
Book Series
</span>
<h3 class="h5">
<?php the_title(); ?>
</h3>
<div class="content">
<div class="content-inner">
<?php the_field('rollover_summary'); ?>
</div>
</div>
<span class="btn-text on-dark">
Explore
</span>
</div>
</div>
</a>
</div>
Field is a Relationship that’s returning Post ID.
The load more button appears for second, then is gone, and nothing else is returned. Not sure what I’m missing?
]]>I have a ACF Repeater and this plugin is pulling it in great (THANKS!)
The repeater has a sub field location (select box) and i was hoping to run different short-codes on different pages to show only results from specific locations is this possible?
]]>I have posts which have an ACF relationship to a Company CPT. I’d like to use ALM to show all the posts that are linked to a given Company. How do I limit the ALM shortcode to a certain company?
I’ve added
acf=’true’ acf_field_type=’relationship’ acf_field_name=’company_id’
to my shortcode, but I’m not sure how to pass in a company_id value to match against.
]]>I’ve created a custom “Gallery” ACF Block using acf_register_block_type() in order to be able to use the ACF Gallery as a Block within the Gutenburg Editor. What is the proper shortcode paramater to use when I have my custom field Location “Rules” set to as “BLOCK is equal to MASONRY GALLERY”?
Essentially… I can only get this to work if the location of my ACF Custom field is set to a specific page or post. If I change the custom field to show as a block within the Gutenburg editor it cant find it.
Thanks
]]>Hello im using the example found here for gallery.
https://connekthq.com/plugins/ajax-load-more/examples/advanced-custom-fields/gallery/
ACF field is set to return format ID, i changed the fallery field to match to mine but all i see is a button and empty divs
Any idea?
]]>ACF Gallery Images are not loading.
I added the following shortcode based on the example provided here: https://connekthq.com/plugins/ajax-load-more/examples/advanced-custom-fields/gallery/#shortcode
The slug for my ACF Gallery is test_gallery so I replaced alm_gallery with test_gallery in the shortcode:
[ajax_load_more preloaded=”true” preloaded_amount=”12″ posts_per_page=”12″ pause=”true” pause_override=”true” scroll=”true” button_label=”Load More” button_loading_label=”Loading…” seo=”true” acf=”true” acf_field_type=”gallery” acf_field_name=”test_gallery” seo=”true” container_type=”div” transition=”fade” images_loaded=”true”]
This gives me the Load More button, but It does not load the images from the ACF Gallery test_gallery.
I am not sure I understand the steps I need to take for this.
Do I replace the default repeater template:
<li <?php if (!has_post_thumbnail()) { ?> class=”no-img”<?php } ?>>
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(‘alm-thumbnail’); }?>
<h3>” title=”<?php the_title(); ?>”><?php the_title(); ?></h3>
<p class=”entry-meta”><?php the_time(“F d, Y”); ?></p>
<?php the_excerpt(); ?>
with the template example found here:https://connekthq.com/plugins/ajax-load-more/examples/advanced-custom-fields/gallery/#template
<div class=”alm-gallery-img”>
” class=”popup”>
” alt=”<?php echo $image[‘alt’]; ?>” />
</div>
Because when I tried to do this I got the following error message: “Something went wrong and the data could not be saved.”
Could you please tell me the exact steps that need to be taken to implement the Ajax Load More for Advanced Custom Fields for an ACF Gallery on a post page?
Thank you very much.
]]>I see multiple people with this question, I too would like this option. When will this be implemented?
]]>I am using gallery field from options page. and using following parameters in my shortcode
[ajax_load_more preloaded="true" preloaded_amount="4" posts_per_page="4" pause="true" pause_override="true" scroll="false" button_label="Load More" button_loading_label="Loading..." seo="true" acf="true" acf_field_type="gallery" acf_field_name="gallery_1_images" acf_post_id="options" seo="true" container_type="div" transition="fade" images_loaded="true"]
It generates markup at frontend but does not fetch images in that markup. The markup looks like below
<li class="no-img">
<h3><a href="" title=""></a></h3>
<p class="entry-meta"></p>
</li>
Does the extentions only support the fields attached specific pages and not if attached with option pages? Any help would be appreciated
]]>Hi, when i call ajax load more in front (static) page it doesn’t work. I got an TypeError: t is null ajax-load-more.min.js:1:19220 when I call it on other pages it loads ok. I even change theme and disable all another plugin but problem still exist.
here is my Repeater Templates code
<?php global $post; ?>
<div class="alm-gallery-img">
<a href="<?php echo $image['url']; ?>" class="popup">
<img src="<?php echo $image['sizes']['large']?>" alt="<?php echo $image['alt']; ?>" />
</a>
</div>
and here is my loop
<?php $args = array( 'post_type' => 'tportfolio' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php echo do_shortcode('[ajax_load_more preloaded="true" preloaded_amount="3" posts_per_page="3" scroll="true" button_label="Load More" button_loading_label="Loading..." acf="true" acf_field_type="gallery" acf_field_name="portfolio" container_type="div" transition="fade"]'); ?>
<?php endwhile;
?>
on front page it load like that https://artwolf.pl/
on another page it’s load ok https://artwolf.pl/test2/
what am I doing wrong ?
]]>I’ve setup Ajax Load More to load more posts.
Within my posts I have an ACF Image field that I want to use a thumbnail in my blog roll page instead of the featured image…
How can I output the image? Every time I try to output even a simple Text field it seems to break everything.
Any help appreciated.
]]>Hey,
Amazing plugin! This is exactly what i’m after.
I’m just wondering if you can help with something. I’m having problems displaying my relationship field data.
I’m using the below to pull it in:
[ajax_load_more preloaded='true' preloaded_amount='1' repeater='template_29' post_type='newexhibitions' posts_per_page='1' orderby='post__in' pause='true' pause_override='true' button_loading_label='Loading...' acf='true' acf_field_type='relationship' acf_field_name='featured_works']
and in the repeater template:
<div class="row">
<div class="item col <?php echo (++$count % 2) ? 'col col-g-6 col-md-6 col-sm-10 col-xs-10 left' : 'col col-lg-offset-6 col-lg-6 col-md-offset-6 col-md-6 col-sm-offset-2 col-sm-10 col-xs-offset-2 col-xs-10 right' ?>">
<div class="image"><a href="<?php the_permalink(); ?>"><img src="<?php the_field('square_thumbnail_image'); ?>" class="lazy" /></a></div>
<div class="text">
<a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
<h4><?php the_field('works-year'); ?></h4>
<a href="<?php the_permalink(); ?>"><strong class="std-button"><span>More Information</span></strong></a>
</div>
</div>
</div>
This seems to be working, however it’s loading the posts within the Custom Post Type newexhibitions rather than the related content in the featured_works field.
Just to confirm, I have the ACF extension installed.
Any ideas would be greatly appreciated ??
Thanks!
]]>Checking to see if there is any support for this yet? I have a repeater field within a flexible content field that I’d like to have a load more option for.
]]>Hey, i’m using the plugin and i have a page with 3 tabs.
Every tab loads data using ajax.
One of the tabs needs to load posts (4 at a time) but the plugin does not work and shows only the “Load More” button.
The posts that i trying to fetch are from the ACF relation field.
I dont get any error message and it feels that something is missing.
on the ajax page that i load i have only the:
Thats my ajax page code:
<?php
require('../../../../wp-load.php');
$postTypeSlug = $_POST['postTypeSlug'];
$posts = get_field('articles', 19);
if( $posts ): ?>
<div class="articles rows-wrapper">
<?php echo do_shortcode('[ajax_load_more container_type="ul" acf="true" acf_post_id="19" acf_field_type="relationship" acf_field_name="articles" post_type="articles" posts_per_page="4" pause="true" transition_container_classes="li-obj col-lg-3 col-md-4 col-sm-6 col-xs-12" button_label="Load More"]') ?>
</div>
<?php endif; ?>
]]>
Hello,
I am trying to integrate this plugin with my AJAX load more that will show 8 images in ACF gallery and then show 4 more every time the AJAX load more button is pressed.
From what I have read it appears to be setup correct, would someone mind reviewing where I might have gone wrong? I will post code examples below.
/* REPEATER TEMPLATE CODE */
<?php
global $post;
$image = get_field(‘client_logos’, $post->ID);
?>
<div class=”logo-image”>
” alt=”<?php echo $image[‘alt’]; ?>” />
</div>
/* SHORTCODE */
<?php echo do_shortcode(‘[ajax_load_more preloaded=”true” preloaded_amount=”8″ posts_per_page=”4″ pause=”true” pause_override=”true” scroll=”false” button_label=”Load More” button_loading_label=”Loading…” acf=”true” acf_field_type=”gallery” acf_field_name=”client_logos” container_type=”div” transition=”fade” images_loaded=”true”]’); ?>
I am also getting the following error in the console which is based in the ajax-load-more.min.js file.
SyntaxError: Unexpected end of JSON input
at parse (<anonymous>)
at Qb (jquery.min.js:4)
at A (jquery.min.js:4)
at XMLHttpRequest.<anonymous> (jquery.min.js:4)
Any help is greatly appreciated.
Thanks in advance.
Craig
]]>I’m getting the error below:
ajax-load-more.min.js?ver=3.2.0:1 Uncaught TypeError: Cannot read property 'html' of null
at Object.n.AjaxLoadMore.success (ajax-load-more.min.js?ver=3.2.0:1)
at Object.success (ajax-load-more.min.js?ver=3.2.0:1)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at y (jquery.js?ver=1.12.4:4)
at XMLHttpRequest.c (jquery.js?ver=1.12.4:4)
I’m using the latest version of ALM and ACF (and the ACF extension) using the Gallery field and for some reason it only happens when the Page that has the shortcode is set as the Home Page in WordPress. If the page is not set as the homepage, I don’t get the error and the grid works as expected. I’ve tried it with my theme and the default theme as well as a fresh install of WordPress with only ALM, ACF and the ACF Extension installed and still get the same problem in the same circumstances.
]]>Is it possible to get this working for a repeater that’s inside of a flexible field?
]]>Hi,
There are two relationship fields in my post, one of theme is for selecting the author and the other one is for selecting a book.
When i do reverse query everything goes fine and ALM works fine. but when it comes to author relationship field it queries current post title and permalink instead of author.
this is the code that i use in repeater template:
<?php
$selectAuthor = get_field('author_book_relation');
if( $selectAuthor ){ ?>
<?php foreach( $selectAuthor as $p): ?>
<?php esc_html_e( 'Analysist: ', 'pastishow' ); ?>
<a href="<?php echo get_permalink( $p->ID ); ?>">
<?php echo get_the_title( $p->ID ); ?>
</a>
<?php endforeach; ?>
<?php } ?>
How can i fix this issue so that ALM query the relationship inside repeater template?
]]>Great plugin, now question how can I change the limit of the gallery it right now uses the amount set by default settings at Reading option and then Blog pages show at most, the shortcode settings seem to be overpassed by WordPress, Is there any way I can change this or is there anything I have to write on the single gallery page (used as a custom post type) for this to work?
]]>