Okay
  Public Ticket #619533
Replace theme shortcode
Closed

Comments

  • Greg started the conversation

    Hello,

    I am trying to override the nectar_portfolio shortcode of your theme from within my child theme.

    Usually this can be done quite easily like this:

    add_action( 'after_setup_theme', 'replace_salient_shortcodes' );
    function replace_salient_shortcodes() {
    remove_shortcode( 'nectar_portfolio' );
    add_shortcode('nectar_portfolio', 'my_custom_nectar_portfolio_processing');
    }
    function my_custom_nectar_portfolio_processing($atts, $content = null) {
    //my custom shortcode behaviour
    }

    However it is not working for the Salient theme. The parent theme shortcode remains in place.

    Can you let me know why this is please? Your theme seems to fire the shortcode in the usual way, so I don't understand why this wouldn't work.

    Thanks.