1. Home
  2. Knowledge Base
  3. WordPress
  4. DIVI
  5. How to deactivate AJAX in the blog module – Divi Theme

How to deactivate AJAX in the blog module – Divi Theme

The blog module uses AJAX to load older posts. If you click on the button for older entries, the blog module will reload instead of refreshing the entire page. This is how AJAX works.

The pagination links have the?et_blog parameter to avoid conflicts with the main query during pagination. It has no effect on SEO as 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 to display the URL of the next page.

To disable AJAX, enter this code in Divi> Theme options> Integration> Add code< Header> 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 only need to deactivate AJAX on one page, you can insert this code into the code module.

To disable AJAX for a specific blog module, add a custom CSS class to the “Advanced settings” tab of the module, for example:

disable_ajax

Next, enter this code in Divi> Theme options> Integration> Add code< Header> of your blog:

<script>
(function($) {
    $(document).ready(function() {
   
        $(".disable_ajax .pagination a").click(function() {
            window.location.href = $(this).attr('href');
           
            return false;
        });
   
    });
})(jQuery);
</script>

Dieser Beitrag ist auch verfügbar auf: Deutsch (German)

Was this article helpful?

Related Articles

Submit a Comment

Your email address will not be published. Required fields are marked *

Published on - 12. Mar 2022
Modified on - 27. Mar 2024
Views - 31
Likes - 0

Do you need help?

Kontaktiere uns gerne :-)
Contact Support
Skip to content