skip to Main Content

I have experience with WordPress but is my first time with Divi. Based on the client design, I need simple change. On the image below you could see block from the blog(a post list used on the homepage in my case)enter image description here

What I need to do is showing the date, category and title in a different order. Which is the best way to change this. I’m using a child theme and I tried to put the file includes/builder/module/blog.php and edit it but I don’t have any luck.

Thanks

2

Answers


  1. Do you have the divi page builder ? If so, it might be possible in the settings of the section where your post is located (you can edit it directly from the front end editor).

    Login or Signup to reply.
  2. You have to move blog.php to correct folder of the child theme first:

    includes/blog.php

    After that, need to modify code, first at the top of the file:

    require_once 'helpers/Overlay.php';
    class ET_Builder_Module_Blog extends ET_Builder_Module_Type_PostBased {
    

    Change to:

    require_once 'helpers/Overlay.php';
    class ET_Builder_Module_Blog extends ET_Builder_Module_Type_PostBased {
    

    Set vb_support to "off"

    Comment out line at the very bottom of the file:

    new ET_Builder_Module_Blog();
    

    And finally, activate new module in the functions.php of your child theme:

    function custom_divi_blog_module() { 
       get_template_part( '/includes/Blog' ); 
       $dcfm = new custom_ET_Builder_Module_Blog(); 
       remove_shortcode( 'et_pb_blog' ); 
       add_shortcode( 'et_pb_blog', array( $dcfm, '_shortcode_callback' ) ); 
    } 
    
    add_action( 'et_builder_ready', 'divi_custom_blog_module' ); 
    
    function custom_divi_blog_module( $classlist ) { 
      $classlist['et_pb_blog'] = array( 'classname' => 'custom_ET_Builder_Module_Blog',); 
      return $classlist; 
    } 
    
    add_filter( 'et_module_classes', 'divi_custom_blog_class' );
    

    After that you can perform required modifications to layout and even add your own features 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search