SmartCrawl incompatible with Extra theme

I'm using SmartCrawl and Extra theme. I'm not able to set Meta details for my homepage. Extra theme has a custom Homepage (by clicking on Settings>Reading>"ExtraTheme Layout). The SC metas not saved there

  • viobru
    • Support

    Hi, Jenks!

    Hope you are doing great :slight_smile:

    I checked this and it seems to be a known issue that is related to the fact that the theme actually has a different approach to load the homepage. Since the theme has its own meta for that page, my teammates from SLS suggested to use the theme options for SEO for the homepage in admin > Extra > Theme Options > SEO > Homepage SEO, and toadd this script to prevent any issues with SmartCrawl since it will allow to use the theme's meta info for the homepage:

    add_filter( 'pre_get_document_title', function( $title ){
        $smartcawl_onpage = Smartcrawl_OnPage::get();
        $resolver = $smartcawl_onpage->get_resolver();
        if ( 'static_home' == $resolver->get_location() ) {
            remove_filter( 'pre_get_document_title', array( $smartcawl_onpage, 'smartcrawl_title' ), 100 );
        return $title;
    }, 20 );

    This code should be added as a mu-plugin or under the functions.php file of your child theme.
    Before applying any change on the site, please make sure to CREATE a COMPLETE and UPDATED backup of the entire site.

    Just to let you know, this fix was provided for a previous version of SmartCrawl, but I confirmed that this code is working fine with SmartCrawl version 2.2.4 as well.

    Please, let us know if you have any further questions regarding this, we are glad to help :slight_smile:

    Have a nice day ahead!

    Kind regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.