This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Add Custom Module

  • Creator
    Topic
  • #1221
    spyke01
    Participant

    So I’m trying to make a module for the theme and have taken the sliders module, modified it, and am trying to get it added from within my child-theme but for some reason the menu item just won’t show. Here’s the code I’ve added to my child theme to try and get the menu loaded.

    /*-------------------------------------------------------*/
    /* Start Child Theme
    /*-------------------------------------------------------*/
    // Start the party ...
    function mod_module_caps( $module_caps ) {
        $module_caps['reviews'] = 'edit_pages';
        return $module_caps;
    }
    add_filter( 'themeblvd_admin_module_caps', 'mod_module_caps' );
    
    function mod_global_config( $setup ) {
        $setup['primary']['reviews'] = true;
        $setup['admin']['reviews'] = true;
        return $setup;
    }
    add_filter( 'themeblvd_global_config', 'mod_global_config' );
    
    // Reviews Framework
    define( 'REVIEWS_FRAMEWORK_URL', TB_FRAMEWORK_URL . '/admin/modules/reviews/' );
    define( 'REVIEWS_FRAMEWORK_DIRECTORY', TB_FRAMEWORK_DIRECTORY . '/admin/modules/reviews/');
    require_once( TB_FRAMEWORK_URL . '/admin/modules/reviews/reviews-framework.php' );

    Any ideas what might be stopping this?

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #1225
    spyke01
    Participant

    Ok figured out that I was staring at the wrong site for most of the troubleshooting (hours of programming will do that to you) and figured out that I needed some more code. Here’s the final (for now) version:

    /*-------------------------------------------------------*/
    /* Start Child Theme
    /*-------------------------------------------------------*/
    // Start the party ...
    function mod_module_caps( $module_caps ) {
        $module_caps['reviews'] = 'edit_pages';
        return $module_caps;
    }
    add_filter( 'themeblvd_admin_module_caps', 'mod_module_caps' );
    
    function mod_global_config( $setup ) {
        $setup['primary']['reviews'] = true;
        $setup['admin']['reviews'] = true;
        return $setup;
    }
    add_filter( 'themeblvd_global_config', 'mod_global_config' );
    
    function mod_locals_js( $locals ) {
    	$newLocals = array ( 
    		'edit_review'		=> __( 'Edit Review', TB_GETTEXT_DOMAIN ),
    		'delete_review'		=> __( 'Are you sure you want to delete the review(s)?', TB_GETTEXT_DOMAIN ),
    		'invalid_review'	=> __( 'Oops! Somehow, you\'ve entered an invalid review type.', TB_GETTEXT_DOMAIN ),
    		'review_created'	=> __( 'Review created!', TB_GETTEXT_DOMAIN ),
    	);
        return array_merge($locals, $newLocals);
    }
    add_filter( 'themeblvd_locals_js', 'mod_locals_js' );
    
    // Reviews Framework
    define( 'TB_CHILD_FRAMEWORK_URL', get_stylesheet_directory().'/framework' );
    define( 'TB_CHILD_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri().'/framework' );
    define( 'REVIEWS_FRAMEWORK_URL', TB_CHILD_FRAMEWORK_URL . '/admin/modules/reviews/' );
    define( 'REVIEWS_FRAMEWORK_DIRECTORY', TB_CHILD_FRAMEWORK_DIRECTORY . '/admin/modules/reviews/');
    require_once( TB_CHILD_FRAMEWORK_URL . '/admin/modules/reviews/reviews-framework.php' );
Viewing 1 replies (of 1 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.