Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Filter WordPress posts by custom taxonomy term with AJAX

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;
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!