Skip to content

Instantly share code, notes, and snippets.

@faisalahammad
Last active December 7, 2021 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faisalahammad/7fd31ff96fe28c4bf6c1d5c9053fc0aa to your computer and use it in GitHub Desktop.
Save faisalahammad/7fd31ff96fe28c4bf6c1d5c9053fc0aa to your computer and use it in GitHub Desktop.

The Blog Module is using AJAX to load older posts. When you click on the older entries button the Blog module is reloading instead of refreshing the entire page. This is the way that AJAX works.

The pagination links have the ?et_blog parameter to avoid pagination clashes with the main query. It has no impact on SEO since the URLs have the "canonical" URL set to the main page.

In some cases, you may want to refresh the page to apply custom styles or in order to see the URL of the next page.

To disable AJAX, place this code to the Divi > Theme Options > Integration > Add code to the < head > of your blog:

<script>
(function($) {
$(document).ready(function() {

$(".et_pb_module.et_pb_posts .pagination a, .et_pb_blog_grid .pagination a").click(function() {
window.location.href = $(this).attr('href');

return false;
});

});
})(jQuery);
</script>

If you need to disable AJAX on one page only you can place that code in the Code Module.

To disable AJAX for a particular Blog module, add a custom CSS class to the Advanced settings tab of the module, for example:

disable_ajax

Next, place this code to Divi > Theme Options > Integration > Add code to the < head > of your blog:
<script>
(function($) {
$(document).ready(function() {

$(".disable_ajax .pagination a").click(function() {
window.location.href = $(this).attr('href');

return false;
});

});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment