Welcome to PressWork!

Want to ask a question or join the discussion? Great! Join now.

In this Discussion

Deactivate messages in front-end editor
  • How can I keep for the superadmin but deactivate for the administrators in a network the front-end editor messages like "Create your Secondary nav menu here"?
  • cbavotacbavota
    This answer was Accepted.
    Those elements are in the presswork_setup() function so you can just rewrite that in your child theme's functions.php file or in a custom-actions.php file:
    function presswork_setup() {
    global $pw_site;
    // This theme allows users to set a custom background
    if(function_exists('add_custom_background'))
    add_custom_background();
     
    // This theme uses wp_nav_menu()
    if(function_exists('register_nav_menu')) {
    register_nav_menu('primary', __('Primary Nav Menu', "presswork"));
    register_nav_menu('secondary', __('Secondary Nav Menu', "presswork"));
    register_nav_menu('footer', __('Footer Nav Menu', "presswork"));
    }
    // The default message if no primary menu is set in the wp-admin
    function pw_menu_default() {
    ?>
    <ul id="menu-main" class="menu">
    <li><a href="<?php echo home_url("/"); ?>">Home</a></li>
    <?php wp_list_categories('title_li=&depth=1&number=5'); ?>
    </ul>
    <?php
    if(current_user_can('edit_theme_options')) {
    echo '<div class="warning clear fl" style="margin-bottom: 5px;"><p>';
    printf(__("Customize your Primary nav menu %shere%s", "presswork"), '<a href="'.admin_url('nav-menus.php').'">', '</a>');
    echo '</p></div>';
    }
    }
     
    // The default message if no secondary menu is set in the wp-admin
    function pw_sub_menu_default() {
    if(current_user_can('edit_theme_options')) {
    echo '<div class="warning clear fl"><p>';
    printf(__("Create your Secondary nav menu %shere%s", "presswork"), '<a href="'.admin_url('nav-menus.php').'">', '</a>');
    echo '</p></div>';
    }
    }
     
    // The default message if no footer menu is set in the wp-admin
    function pw_footer_menu_default() {
    if(current_user_can('edit_theme_options')) {
    echo '<div class="warning clear fl"><p>';
    printf(__("Create your Footer nav menu %shere%s", "presswork"), '<a href="'.admin_url('nav-menus.php').'">', '</a>');
    echo '</p></div>';
    }
    }
     
    // Add a way for the custom header to be styled in the admin panel that controls
    // custom headers. See pw_admin_header_style(), below.
    add_custom_image_header('pw_header_style', 'pw_admin_header_style');
     
    define('NO_HEADER_TEXT', true );
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE_WIDTH', $pw_site); // use width and height appropriate for your theme
    if(!defined('HEADER_IMAGE_HEIGHT'))
    define('HEADER_IMAGE_HEIGHT', 160);
     
    if(function_exists('add_theme_support')) {
    // Add functionality for post thumbnails/featured image
    add_theme_support( 'post-thumbnails' );
    add_image_size( 'fifty', 50, 50, true );
    add_image_size( 'small', 80, 80, true );
    add_image_size( 'sticky', pw_theme_option('content_width'), 240, true );
     
    //Add default posts and comments RSS feed links to head
    add_theme_support( 'automatic-feed-links' );
     
    //Add functionality for post formats
    add_theme_support( 'post-formats', array( 'aside', 'audio', 'gallery', 'image', 'link', 'video' ) );
    }
    }


    Just change the current_user_can('edit_theme_options') to is_super_admin().
    image Senior Developer & Co-Founder of PressWork
  • Thank you
  • cbavota, is it possible to deactivate the front-end editor for other admins in a single-site installation of WordPress? I have some admins that will likely be confused by the Presswork theme. These few users need some admin functions, but not theme config functions.

    My other option is to simply downgrade their user rights to perhaps Editor. Thoughts?