Please advise....
I create filter taxonomy using this tutorial: https://www.bobz.co/blog/demo-filter-wordpress-posts-custom-taxonomy-term-ajax/
It is echoing all my codes but when I click to certain tag it stop showing me images only.
I am using ACF Gallery code for images in template.
<?php
$images = get_field('gallery');
if( $images ): ?>
<ul>
<?php foreach( $images as $image ): ?>
<li>
<a href="<?php echo $image['url']; ?>">
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
</a>
<p><?php echo $image['caption']; ?></p>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
I check ajax filter post file and try to edit code but still fails to do so can you please help me out with it.
I want gallery to be display with certain posts when I click on "TAGS"
$output = '<h2><a href="'.get_permalink().'">'. get_the_title() . '</a></h2>';
$output .= get_the_excerpt();
$result = 'success';
endwhile; else:
$output = '<h2>No posts found</h2>';
$result = 'fail';
endif;
There is not a way we can say whats happening unless seeing it.
Additionally, if you want get the ACF fields from the current page then you must pass the post id. So, it might help you by guessing but not debugging your problem.
$images = get_field('gallery', $post_id);
$post_id should be the id of that particular post you want to show.
Hope this works as guessing your problem for now.
If you give us more details we can see and inspect the problem more easily.
Thanks