• Evan Herman

    (@eherman24)


    Not sure what the intention of this was – but within the homepage sections you’ve written your own custom content filter, which is stripping out short code support.

    A user reported an issue with our plugin, but after some bug hunting we were able to track it back to your theme – and a few functions you have written to generate the content on the front end (specifically on the homepage).

    I’m not sure if this is a marketing ploy to try and upsell users to a pro vesion, or if you really just don’t want users to enter shortcodes on the homepage – but it seems to be causing some issues where users can not parse shortcodes inside of the WordPress editor of the homepage theme options sections.

    Offending Function:
    skt_white_the_content_format( $content );

    Additional helper functions:

    // get_the_content format text
    function skt_white_get_the_content_format( $str ){
         $raw_content = apply_filters( 'skt_white_the_content', $str );
         $content = str_replace( ']]>', ']]>', $raw_content );
         return $content;
    }
    
    // the_content format text
    function skt_white_the_content_format( $str ){
         echo skt_white_get_the_content_format( $str );
    }

    If anyone else comes across this and is looking to provide shortcode support inside of the homepage content areas, simply alter skt_white_get_the_content_format() to the following:

    // get_the_content format text
    function skt_white_get_the_content_format( $str ){
         return apply_filters( 'skt_white_the_content', $str );
    }

    Inside of functions.php, around line #236.

    Pro Tip: Before you buy any theme, I would do some form of code audit (or at least research the author) – to ensure what you are paying for is up to date with the latest code standards and secure.

    Evan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author sonalsinha21

    (@sonalsinha21)

    Hi Evan,

    We are aware of it. But we can’t update the theme as WordPress theme review team has changed and made compulsory to use customizer instead of using theme options.

    So even if we want to change it we can’t because that would mean breaking 10,000+ sites which use this theme and then making it as per rules of new WordPress theme and also porting all data into customizer which won’t be possible as well as per new rules.

    Thanks again for pointing this out anyways.

    Hi Evan,
    I have actually just ran into this problem, I have tried replacing

    // get_the_content format text
    function skt_white_get_the_content_format( $str ){
    	$raw_content = apply_filters( 'skt_white_the_content', $str );
    	$content = str_replace( ']]>', ']]>', $raw_content );
    	return $content;
    }

    in the functions.php with you suggested

    // get_the_content format text
    function skt_white_get_the_content_format( $str ){
         return apply_filters( 'skt_white_the_content', $str );
    }

    But I was still unable to use shortcodes inside the section areas of the SKT-white theme. The page shows the shortcode as it is “[shortcode]”. Do you have any suggestion?

    Hi Evan,

    We are aware of it. But we can’t update the theme as WordPress theme review team has changed and made compulsory to use customizer instead of using theme options.

    So even if we want to change it we can’t because that would mean breaking 10,000+ sites which use this theme and then making it as per rules of new WordPress theme and also porting all data into customizer which won’t be possible as well as per new rules.

    Thanks again for pointing this out anyways.

    I understand that changing this would break many websites already using the theme. Is there a workaround for users of your theme who want to use shortcodes inside the section areas on the front page? I really like the theme, but I also need to explore its potential.
    Thank you

    @setecorp were you able to get a workaround?

    @incredibleanand No, I ended up creating a new editable section on the Homepage template where I added my shortcodes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stripping Shortcodes on Homepage Sections’ is closed to new replies.