• Hey,

    I am a theme developer and I am using the below code to set default options and to set my custom template for YARPP on theme switch.

    function mstoic_theme_switch_function() {

    /* STOP YARPP FROM AUTO DISPLAY, SET CUSTOM YARPP TEMPLATE */
    yarpp_set_option(‘auto_display’, false);
    yarpp_set_option(‘use_template’, true);
    yarpp_set_option(‘template_file’, ‘yarpp-template-mstoic.php’);

    }

    add_action( ‘after_switch_theme’, ‘mstoic_theme_switch_function’ );

    But this code is not working as expected.

    https://ww.wp.xz.cn/plugins/yet-another-related-posts-plugin/

The topic ‘Set default values on theme switch’ is closed to new replies.