Skip to content

Add fix for Avada Layout Builder duplicate content #266

@CodyReichert

Description

@CodyReichert

The Avada theme has a bug in their Layout Builder where the_content is generated for the header, body, and footer. This causes duplicate content on our listing details pages.

This should fix the issue. We should find a way to add this to our plugin so users don't have to add it themselves.

  1. Go to the Appearance->Theme File Editor page in your WordPress dashboard
  2. Make sure Select theme to edit is Avada Child
  3. In the functions.php file, paste the following code (below any existing code is fine):
add_action('awb_remove_third_party_the_content_changes', 'sr_avada_remove_filters', 10);

function sr_avada_remove_filters() {
    if (class_exists('SimplyRetsCustomPostPages' )) {
        remove_filter('the_content', array('SimplyRetsCustomPostPages', 'srPostDefaultContent'));
    }
}

add_action('awb_readd_third_party_the_content_changes', 'sr_avada_readd_filters', 20);

function sr_avada_readd_filters() {
    if (class_exists( 'SimplyRetsCustomPostPages' )) {
        add_filter('the_content', array('SimplyRetsCustomPostPages', 'srPostDefaultContent'));
    }
}

Metadata

Metadata

Assignees

Labels

bugThis fixes or addresses a bugenhancementThis is an enhancement or new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions