40 Comments

  1. A B
    February 20, 2021 @ 8:46 pm

    Does this still work? I've probably missed something but when I require the files in functions the filtering appears above the nav, and when I require them in index, I get a bad request error code 400.

    Reply

  2. carla debos
    February 20, 2021 @ 8:46 pm

    hi thanks a lot fir this tutorial!
    how could this work to show all the posts from two (or more) selected categories? i'm stuck :-'''(((

    Reply

  3. Gi Wai Echo Hui
    February 20, 2021 @ 8:46 pm

    Thank you for the tutorial! I've got the filter post working. However, I use require_once('ajax/example.php'); in function.php, the media library does not function properly afterward. Is there something wrong with the place to put require_once('ajax/example.php'); ?

    Reply

  4. Lukas Luftläufer
    February 20, 2021 @ 8:46 pm

    OMG! My first working AJAX-Request! Have been looking to implement this feature a long time! Thanks a million times!

    Reply

  5. arber.studio
    February 20, 2021 @ 8:46 pm

    Nice! That def did it. Suggestion, browser history states!

    Reply

  6. Zissis Vassos
    February 20, 2021 @ 8:46 pm

    You are a god that was so well explained! Thank you!

    Reply

  7. joanica cardoso
    February 20, 2021 @ 8:46 pm

    Hi Ryan! Thanks so much for sharing this tutorial.
    When I click on the categories it just appears a blank page with the text "require_once('inc/scripts.php'); require_once('inc/ajax/example.php');"
    That step wasn't clear to me, I'm a total newbie on this 🙂
    Maybe it's just the path to the files that is wrong? (it's a wp project still on localhost). Any tip?

    Reply

  8. Mahfuzur Rashid
    February 20, 2021 @ 8:46 pm

    anyone got the code working please share

    Reply

  9. Moonsoftgroup
    February 20, 2021 @ 8:46 pm

    Hi All, You can simply do this with plugin 'Category Ajax Filter'. Plugin is available in wordpress directory. I just downloaded it and think it would be useful for you too. Plugin has many features like to select custom post type and more controls from the wordpress backend. Here is the plugin link https://wordpress.org/plugins/category-ajax-filter/
    Thanks Guyz

    Reply

  10. creative shewa
    February 20, 2021 @ 8:46 pm

    good job

    Reply

  11. Patryk B
    February 20, 2021 @ 8:46 pm

    But url hash doesen't changes?

    Reply

  12. muhammad adnan
    February 20, 2021 @ 8:46 pm

    the same process will work for woocommerce products by categories ?

    Reply

  13. sarita saldanha
    February 20, 2021 @ 8:46 pm

    Thank you Ryan for the videos, however I am getting an error "admin-ajax.php 500 (Internal Server Error)" could you please suggest how to solve this issue?

    Reply

  14. Kavan Rodriguez
    February 20, 2021 @ 8:46 pm

    Thanks really helpful

    Reply

  15. Michelle Ersan
    February 20, 2021 @ 8:46 pm

    Thank you so much for the video. Very well explained and super useful. But if I click on the category the posts and categories are not displayed at all, no error message and I went through everything many times but can't find the issue X( I uploaded my files to GitHub and hope you could have a look what the problem is. So desperate just to know what I did wrong…
    https://github.com/Micheellee/WordPress-Ajax-Filter/tree/master/Ajax%20Filter

    Reply

  16. yuc0n
    February 20, 2021 @ 8:46 pm

    Very useful man, thanks <3

    Reply

  17. Sattaya Kongkom
    February 20, 2021 @ 8:46 pm

    can I download your file ? thx.

    Reply

  18. WOLVESFC
    February 20, 2021 @ 8:46 pm

    Hi mate, any chance you could post the code up somewhere so i could use it please? Thanks

    Reply

  19. Designweb Moldova
    February 20, 2021 @ 8:46 pm

    thx man, keep going!

    Reply

  20. I Han
    February 20, 2021 @ 8:46 pm

    Thanks you so much, this clear and straightforward tutorial helped me out a lot!!

    Reply

  21. Michal Fridrich
    February 20, 2021 @ 8:46 pm

    Thank you ! Nice, clean and simple.

    Reply

  22. Russ Glove
    February 20, 2021 @ 8:46 pm

    Awesome! I'm none the wiser

    Reply

  23. Manuel Castro
    February 20, 2021 @ 8:46 pm

    Thanks, Great Work!!!
    You think there is a way to do the same with The Custom Meta Key Values?
    I'm breaking my head trying to make it work T_T

    Reply

  24. Ria Yaoto
    February 20, 2021 @ 8:46 pm

    Thank you for this. Everything works except in 'All' link. When I tried to put an active classname via script. The all post is not displaying at all in when I click 'All'. How to fix it?

    Reply

  25. MarCode
    February 20, 2021 @ 8:46 pm

    How could I paginate an ajax result?

    Reply

  26. Awesome Adijos
    February 20, 2021 @ 8:46 pm

    Do you know how to add to this pagination?

    Reply

  27. Vladimir Bondarenko
    February 20, 2021 @ 8:46 pm

    Thanks! Keep up sharing your knowledge!

    Reply

  28. Faizan Saeed
    February 20, 2021 @ 8:46 pm

    On this same project please add load more button pagination ajax based. Waiting for that tutorial.

    Reply

  29. Missy Turco
    February 20, 2021 @ 8:46 pm

    Thank you so much for this! I have been afraid of Ajax for a while and you made it seem very attainable!

    Reply

  30. Terry Turner
    February 20, 2021 @ 8:46 pm

    Thanks, Ryan! I have this working for the most part. However, I noticed that using admin-ajax.php works fine only when logged in as an admin or completely logged out. For subscribers/contributors it does not work at all and all ajax attempts simply call the homepage instead. Any thoughts on this? Just to note, I do have wp_ajax_nopriv_filter set

    Reply

  31. Fran Green
    February 20, 2021 @ 8:46 pm

    Thanks for this. This is the best guide I've seen so far for creating AJAX filters on WordPress. Thankyou! I'm slightly stuck though… My Category links are trying to return an archive template rather than sorting on the page… what have I done wrong? Its got to be something in the .js but I can't see what!

    Reply

  32. Dharmin Patel
    February 20, 2021 @ 8:46 pm

    Hello Thanks for this video , My Question is how can i set number pagination in ajax . My pagination not work in category ajax

    Reply

  33. Guy iorio
    February 20, 2021 @ 8:46 pm

    Amazing 3 part tutorial Ryan! Thanks for making this – it's helping me majorly with a project i'm working on. I'm having an issue though where the categorized posts aren't being filtered when clicking on the category links. The 4 posts just remain the same. Here's the github link if you have a sec to take a look at it: https://github.com/Guyiorio/WordPressAjax_RyanMcGovern_Lesson any idea what I might be overlooking? Spent a few hours trying to figure out what I did wrong but to no avail..I'm using LocalByFlywheel for my local sites if that makes any difference.

    Reply

  34. Michael Thomas
    February 20, 2021 @ 8:46 pm

    It works!! Thanks mate! I'm in the middle of the biggest project of my career and your tutorial here is a life saver. YouTube is clearly not saturated because I couldn't find anything on here that shows me how to do this step by step using ajax!

    Reply

  35. Konstantin Krischke
    February 20, 2021 @ 8:46 pm

    Thank you for the helpfull tutorial and i finally found all the stupid errors 😉

    Reply

  36. Robert Meza Garcia
    February 20, 2021 @ 8:46 pm

    Hi Ryan, I have to import example.php in a file? cause when I test it, in the console displays localhost/wp/wp-admin/admin.ajax.php 400 bad request. I couldn't solve this problem, please help !!

    Reply

  37. max shin
    February 20, 2021 @ 8:46 pm

    Thank you Ryan. I did what you told me, but it doesn't work… TT when i clicked category link, not only the content area appears, but the whole thing that includes the header and footer… Help me.. what is wrong..

    Reply

  38. James Williamson
    February 20, 2021 @ 8:46 pm

    Thanks my brother, this simply works!!!

    Reply

  39. zeng wenyu
    February 20, 2021 @ 8:46 pm

    In part-3, what is $args['department__in'] use for, my Ajax was success, but it's always return same data, not exactly category correspond to the item got clicked.
    Thank you Ryan.

    Reply

  40. Melissanthi Saliba
    February 20, 2021 @ 8:46 pm

    Hi Ryan, thank you for this tutorial.
    Is there a way to also have the url reflect the change of category on click?

    Reply

Please Login to post a comment

X

Forgot Password?

Join Us