Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fix for Avada Layout Builder duplicate content #266

Open
CodyReichert opened this issue Apr 18, 2024 · 0 comments
Open

Add fix for Avada Layout Builder duplicate content #266

CodyReichert opened this issue Apr 18, 2024 · 0 comments
Assignees
Labels
bug This fixes or addresses a bug enhancement This is an enhancement or new feature

Comments

@CodyReichert
Copy link
Member

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'));
    }
}
@CodyReichert CodyReichert added bug This fixes or addresses a bug enhancement This is an enhancement or new feature labels Apr 18, 2024
@CodyReichert CodyReichert self-assigned this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This fixes or addresses a bug enhancement This is an enhancement or new feature
Projects
None yet
Development

No branches or pull requests

1 participant