Besides Divi I’m using the Divi Children plugin (developed by Luis Alejandre who runs divi4u.com). It’s a great plugin to help you create a child theme for Divi and adds some extra functionality as well.

I recently updated to Divi 2.3 where the offset function was introduced in the blog module. However, it didn’t want to work. Click on Read more to learn about the “bug” and the fix.

The offset

The offset function in the blog module is a great addition. It basically allows you to have several blog modules on the same page, and you can tell each module how many blog entries it should skip. For example you can have a wide blog module on the top showing the latest entry, then another one below with 2 columns. In the second one you obviously don’t want to show the post that already appears on the top, so you just need to set the offset value to 1, and ta-daaaa!

This is what I expected, but the offset didn’t work.

The “bug”

Thanks to the help of ET support (these guys are amazing!!!) they quickly figured there’s something wrong with the child theme. More specifically it is a child theme generated by the Divi Children 2.0 plugin (with Divi Children Engine Version: 1.0.0).

I did some digging and found out, that the engine is missing some lines of code that have been added to Divi with the 2.3 update. So these need to be added to the Divi Children Engine. I’m sure this will be fixed in the next version of the Divi Children plugin. But if you need a solution now, then keep reading.

The fix

And here it becomes a bit technical, but don’t despair, you just need notepad or your favourite code editor and copy a few lines of code. (Don’t forget to make a backup first, just in case!!!)

Open this file in your favorite code editor:

wp-content\themes\{your-child-theme}\divi-children-engine\includes\divi-mods\divi_mod_functions.php

1. The code starting at line 17 looks like the below, except for the line in red. Add that line.

extract( shortcode_atts( array(
    'module_id' => '',
    'module_class' => '',
    'fullwidth' => 'on',
    'posts_number' => 10,
    'include_categories' => '',
    'meta_date' => 'M j, Y',
    'show_thumbnail' => 'on',
    'show_content' => 'off',
    'show_author' => 'on',
    'show_date' => 'on',
    'show_categories' => 'on',
    'show_pagination' => 'on',
    'offset_number' => 0,
    'background_layout' => 'light',
    'show_more' => 'off',
  ), $atts
) );

2. Around line 50 you will find this. Again add the section in red.

if ( ! is_search() ) {
    $args['paged'] = $et_paged;
}
if ( '' !== $offset_number && ! empty( $offset_number ) ) {
    $args['offset'] = (int) $offset_number;
}

Save, upload, and you are set! This does the fix and you can use the offset in the Divi blog module as it was meant to be used.

bugfix, Divi, WordPress

css.php

Pin It on Pinterest

Share This