How to Add a Load More Button in the Divi Blog Module

Are you looking for a way to add a load more button in the Divi blog module?

If you’re using the popular Divi theme for your WordPress website, you’ve likely discovered its flexibility and ease of use. Divi empowers you to create stunning designs and layouts without needing to be a coding expert. One handy feature you might want to implement on your blog page is a “Load More” button. This button allows visitors to view additional blog posts without having to navigate away from the page.

In this tutorial, we’ll walk you through the steps to add a load more button in the Divi blog module.

Steps to Add a Load More Button in the Divi Blog Module:

Discover the steps to effortlessly add a Load More button in the Divi Blog Module, enhancing your WordPress website’s user experience.

Disable Pagination

Step 1: Access the module settings.

Step 2: Go to the Content tab.

Step 3: Find the Elements section.

Step 4: Set “Show Pagination” to NO.

Disable Pagination

Add a Unique CSS Class Name

Step 1: Access the module settings.

Step 2: Click on the “Advanced” tab.

Step 3: Find the CSS ID & Classes section.

Step 4: Add the class “load_more_mc_starters_blog” in the CSS Class input field.

Add a Unique CSS Class Name

Add the Button Module

Step 1: Below the Blog module, add a new Button module.

Step 2: Customize the Button module to create the “Load More” button to your liking.

Step 3: In the Button module settings, go to the “Advanced” tab and select “CSS ID & Classes.”

Step 4: Add the CSS ID “load_more_mc_starters_blog” to link the Blog module and the “Load More” button properly.

Add the JavaScript Snippet

Add the JavaScript Snippet

Step 1: Go to the WordPress dashboard. Click on Divi -> Theme Options

Step 2: Click on the “Integration” tab.

Step 3: Paste the given JavaScript snippet into the “Add code to the <head> of your blog” field.

<script>
jQuery(document).ready(function(){
    // Check if the screen width is below 767px (for mobile screens)
    if (window.matchMedia('(max-width: 767px)').matches) {
        var initial_show_article = 3; // Number of articles initially displayed
        var article_reveal = 2; // Number of articles to reveal on each button click

        // Hide articles beyond the initial display count
        jQuery(".load_more_mc_starters_blog").not( ":nth-child(-n+"+initial_show_article+")" ).css("display","none");

        // When the "Load More" button is clicked
        jQuery("#ap_load_more_button_id").on("click", function(event){
            event.preventDefault();

            // Increase the count of displayed articles
            initial_show_article = initial_show_article + article_reveal;

            // Display additional articles
            jQuery(".load_more_mc_starters_blog").css("display","block");

            // Hide articles beyond the updated display count
            jQuery(".load_more_mc_starters_blog").not( ":nth-child(-n+"+initial_show_article+")" ).css("display","none");

            // Check if all articles are displayed and hide the button if necessary
            var articles_num = jQuery(".load_more_mc_starters_blog").not('[style*="display: block"]').length;
            if (articles_num == 0){
                jQuery(this).css("display","none");    
            }   
        })
    } else {
        // For desktop screens
        var initial_row_show = 2; // Number of rows initially displayed
        var row_reveal = 1; // Number of rows to reveal on each button click

        var total_articles = jQuery(".load_more_mc_starters_blog").length;

        // Hide articles beyond the initial row display count
        jQuery(".load_more_mc_starters_blog").not( ":nth-child(-n+"+initial_row_show+")" ).css("display","none");

        // When the "Load More" button is clicked
        jQuery("#ap_load_more_button_id").on("click", function(event){
            event.preventDefault();

            // Increase the count of displayed rows
            initial_row_show = initial_row_show + row_reveal;

            // Display additional rows
            jQuery(".load_more_mc_starters_blog").css("display","block");

            // Hide rows beyond the updated display count
            jQuery(".load_more_mc_starters_blog").not( ":nth-child(-n+"+initial_row_show+")" ).css("display","none");

            // Check if all rows are displayed and hide the button if necessary
            var articles_num = jQuery(".load_more_mc_starters_blog").not('[style*="display: block"]').length;
            if (articles_num == 0){
                jQuery(this).css("display","none");    
            }    
        })
    } 
})
</script>

Step 4: Save your changes to activate the “Load More” button feature on your Divi Blog Module.

By following these steps, you’ll enable the add a load more button in the Divi blog module.

After adding the button, save your changes and exit the Divi Builder. View your page, and you should see the “Load More” button at the bottom of your blog posts. Clicking it will load additional posts without reloading the page.

Congratulations! You’ve successfully added a “Load More” button to your Divi Blog Module, enhancing the user experience on your WordPress website. Visitors can now explore more of your content with ease.

Remember to adjust the JavaScript code and button design to fit your specific needs and styling preferences. Happy blogging with Divi!

What is the purpose of assigning a CSS class and ID to the Blog and Button modules?

Assigning a CSS class (e.g., “load_more_mc_starters_blog”) to the Blog module and a CSS ID (e.g., “ap_load_more_button_id”) to the Button module helps link them and allows the JavaScript code to control their interactions for the “Load More” functionality.

Can I customize the number of initial posts displayed and the increment on each click of the “Load More” button?

Yes, you can customize these settings in the JavaScript code. Depending on screen width (mobile or desktop), you can adjust the initial_show_article, article_reveal, initial_row_show, and row_reveal variables to control the display and increment of posts or rows.

How to Change WordPress Footer?

Utilizing a footer effectively is a simple way to enhance the user experience and the functionality of your site. The change WordPress Footer? is a crucial area at the bottom of each page.

Navigation: Helps users easily find important sections, enhancing user-friendliness.

Contact: Houses quick-access contact information, fostering better connections.

Professionalism: Gives the site a neat and trustworthy appearance by displaying important links and legal information, building trust with your audience.

In this guide, we’ll walk you through changing your WordPress footer, covering its importance and step-by-step instructions for effective customization, enhancing your website’s functionality and appeal.

Change WordPress Footer: Step-by-Step

Utilizing these methods, including the ‘Footer template of Mc Starters,’ will empower you to optimize your website’s footer section, enhancing the user experience and potentially increasing visitor engagement.

There are several methods to customize your WordPress footer. This guide will explore techniques using Elementor, the Divi Page Builder, and the Header and Footer Plugin.

Change Footer in WordPress Elementor Pro

Elementor simplifies creating and customizing your WordPress footer with its user-friendly page builder.

Step 1: Download our pre made Elementor footer from Mc Starters and import into Elementor library.

Step 2: Go to the Elementor theme builder to start making a new footer.

Step 3: Utilize the footer that you downloaded and imported in step 1.

Check out complete step by step Import Footer into Elementor pro documentation.

Change Footer in WordPress Divi Page Builder

Divi Page Builder streamlines footer customization with its user-friendly approach, making it easy for all users.

Step 1: In your WordPress dashboard, go to the “Divi” tab. Select “Theme Builder” from the Divi menu.

Step 2: Click on “Add Global Footer” to create a new footer template.

Step 3: You can choose to build your footer from scratch or add a pre-made footer template from the Mc Starters by selecting “Add From Library.”

Step 4: Click to save your changes, updating your site’s footer.

Check out complete step by step Import Footer into Divi Page Builder.

Change Footer using WordPress Header and Footer Plugin with Elementor free

Changing your WordPress Footer is made straightforward using the Header and Footer Plugin, ensuring accessibility for all users.

Step 1: Install Header and Footer builder plugin.

Step 2: Go to Appearance > Header and Footer Builder > Create new footer.

Step 3: Download footer templates from Mc Starters > Import Footer > Insert footer into Elementor page builder.

If you are stuck check documentation. How to import footer in Elementor free.

Conclusion

You can easily transform your WordPress footer into a personalized and functional element of your website. Customizing your footer not only enhances the overall appearance but also improves user experience, helping you engage your visitors effectively.

We hope this guide has empowered you to make the most of your website’s footer, contributing to a more professional and engaging online presence.

How do I edit the footer in WordPress?

Edit the footer in WordPress using a page builder like Elementor or by modifying the footer template directly in your theme’s code.

How do I add a custom footer in WordPress?

Add a custom footer in WordPress by creating a new footer template with a page builder or designing a custom footer in HTML/CSS and integrating it into your theme’s code.

How do I edit an existing footer?

Edit an existing footer in WordPress by accessing the WordPress dashboard, locating the footer area, and making changes using a page builder or by directly editing the footer code.

How do I change the bottom footer in WordPress?

Change the bottom footer in WordPress by accessing the theme’s footer template in the theme settings or editing the theme’s code, or by using a page builder to customize it.

How do I edit a footer in WordPress with Elementor?

Edit a footer in WordPress with Elementor by installing and activating the Elementor plugin, then customizing the footer section on the desired page using the Elementor editor.

How do I change the Footer in WordPress with Divi?

Change the footer in WordPress with Divi by installing and activating the Divi plugin, opening the page you want to edit, clicking “Edit with Divi Builder,” locating the footer section, and customizing it using Divi’s interface.

Get Professional Websites