Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    What exactly are you referring to, that working on the first link, but not the second?

    Thread Starter Bogdan

    (@bogdanguenther)

    Hi Till,

    Thank you for your fast reply. Well in the first page the email addresses are encoded when I look into the HTML source but not on the second page.

    Thanks,
    Bogdan

    Plugin Author Till Krüss

    (@tillkruess)

    Ah, right, sorry. I just confused with a different plugin.

    I don’t have access to the Divi theme, but it looks like that the content on the 2nd links does not have the the_content filters applied.

    I’d recommend you to contact the Divi support team and ask which filter is applied to all of their content blocks and then add it manually:

    add_filter( 'some_divi_filter', 'eae_encode_emails' );
    Thread Starter Bogdan

    (@bogdanguenther)

    Thank you Till, I will try this.

    Jake Jackson

    (@blue-liquid-designs)

    Oddly enough, just running it through the_content filter was enough to get it working with Divi.

    add_filter( 'the_content', 'eae_encode_emails' );

    Plugin Author Till Krüss

    (@tillkruess)

    Ah, maybe Divi does something funky with the_content() and this plugins filter priority of 1000 is too high, you can adjust it using the EAE_FILTER_PRIORITY constant.

    Thread Starter Bogdan

    (@bogdanguenther)

    I got this reply from the Elegant Themes Support:

    I see, thank you.
    Yes, page builder does not use the_content () function, bc it’s not possible via shortcodes. Bc you can use many text module on a page and if you use the_content () then it will display the same content all for all the text modules. So page builder uses custom function for that. The functions is located on line 2371. Here is it

    do_shortcode( et_pb_fix_shortcodes( $content ) )

    So, I’m not sure if that’s possible to fix it at all. If your plugin supports shortcodes then maybe there is a work around, but I think the plugin does not work for shortcodes. You can contact plugin support again to ask about it. Thanks

    @blue Liquid Designs: Thank you, this worked for me, too!

    Plugin Author Till Krüss

    (@tillkruess)

    Hey Bogdan,

    please ask the Elegant Themes Support if they provide a filter that is applied to the page/widget contents.

    Cheers!

    Mark

    (@markeasyitmecom)

    Hello Guys,
    My other solution for Divi was to put the
    <?php $et_email = eae_encode_emails($et_email);?>
    code to the header.php, right after the line:
    <?php if ( ” !== ( $et_email = et_get_option( ‘header_email’ ) ) ) : ?>
    I hope it helps.

    Also my question, where do you put the aforementioned add_filter( ‘the_content’, ‘eae_encode_emails’ ); code in the solution above?

    Thanks,
    Mark

    Plugin Author Till Krüss

    (@tillkruess)

    Hey Mark!

    If it’s a custom theme, you could put it in your theme’s functions.php, but if it’s a 3rd-party theme (like Divi) changes to that that file will lost on each theme update. In that case I recommend to use a Must Use Plugin.

    Same applies to your solution of adding eae_encode_emails() to header.php. Every theme update will undo that. If you post the source code of et_get_option(), I might be able to find a filter, so you can solve this permanently.

    Mark

    (@markeasyitmecom)

    Hi Till,
    Thanks for your reply!
    Interestingly putting that into functions.php with Divi brakes the theme: it just doesn’t work, I get a white screen.
    I use a child-theme, so my changes won’t disappear with the updates, however I like you solution suggestion better, here is the code from custom-functions.php

    Cheers,

    Mark

    if ( ! function_exists( ‘et_get_option’ ) ){
    function et_get_option( $option_name, $default_value = ”, $used_for_object = ” ){
    global $et_theme_options, $shortname;

    if ( et_options_stored_in_one_row() ){
    $et_theme_options_name = ‘et_’ . $shortname;

    if ( ! isset( $et_theme_options ) ) $et_theme_options = get_option( $et_theme_options_name );
    $option_value = isset ( $et_theme_options[$option_name] ) ? $et_theme_options[$option_name] : false;
    } else {
    $option_value = get_option( $option_name );
    }

    // option value might be equal to false, so check if the option is not set in the database
    if ( ! isset ( $et_theme_options[$option_name] ) && ” != $default_value ) {
    $option_value = $default_value;
    }

    if ( ” != $used_for_object && in_array( $used_for_object, array( ‘page’, ‘category’ ) ) && is_array( $option_value ) )
    $option_value = et_generate_wpml_ids( $option_value, $used_for_object );

    return $option_value;
    }
    }

    Plugin Author Till Krüss

    (@tillkruess)

    Hey Mark,

    the et_get_option() sadly doesn’t use any filters we can hook into. Pity.

    However the functions.php of your child theme is a great place to add customizations. If you get a “white screen of death”, just enable WP_DEBUG in your wp-config.php to see what’s exactly causing the fatal error.

    @bogdan: Is it still working with the actual version of DIVI on your site?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Does not work with Divi-Theme?’ is closed to new replies.