Get posts by category via ajax
Add the category ID to category list items <div class=”category-block” data-cid=”{ID-OF-CAT}”>, you will need it in the ajax request. You must also include action in the request and display received data. Here you can read more about AJAX in WP. blog.js (function($) { $(document).ready(function() { var cat_buttons = $(“.category-block”); cat_buttons.on( ‘click’, function(event){ // event.preventDefault(); var … Read more