Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter anton1234

    (@anton1234)

    To get the theme menu to show I did the following:

    Making a custom capability, changing in the backend.php “manage_options” into your newly created capability, and then adding that capability to the desired roles.

    But now I get error messages on the editor role, but not on the admin side.

    UNDEFINED TYPE custom_slides

    And when I try to change something from the editor role it doesn’t feed the changes on the front end, it bugs out. Also what I noticed was that the the theme’s menu directs to /wp-admin/admin.php?page=###. Could that be the reason why an editor can’t feed changes?

    • This reply was modified 8 years, 9 months ago by anton1234.
    • This reply was modified 8 years, 9 months ago by anton1234.
    • This reply was modified 8 years, 9 months ago by anton1234.
    Thread Starter anton1234

    (@anton1234)

    Also found this in themename.backend.php:

    	function smt_load_menu() {
    		
    		global $smt_default_options;
    		
    		$theme = wp_get_theme( );
    		add_menu_page( 'Theme', $theme['Name'], 'manage_options', 'smt_settings', 'smt_settings_handle', '', 64 );
    		foreach( $smt_default_options as $name => $section ) {
    			
    			$s=add_submenu_page( 'smt_settings', $section['name'], $section['name'], 'manage_options', 'smt_'.$name, 'smt_settings_handle' );
    			add_action( 'admin_print_scripts-'.$s, 'smt_admin_scripts' ); // 
    			
    		}
    		remove_submenu_page( 'smt_settings', 'smt_settings' );
    		
    	}

    The 2 are the only mentions of the “manage_options” capability in the whole theme.

    • This reply was modified 8 years, 9 months ago by anton1234.
    • This reply was modified 8 years, 9 months ago by anton1234.
    Thread Starter anton1234

    (@anton1234)

    My end result:

    function login_bar ( $atts, $contents) {
       ob_start();
     echo '<div class="message"><div class="welcome">';
       if ( is_user_logged_in() ) {
            $current_user = wp_get_current_user();
        echo 'Welcome, ' , esc_html( $current_user->display_name );
    } else {
        echo 'Welcome, visitor!';
    }
    echo '</div><div class="action">';
    if ( is_user_logged_in() ) {
            $current_user = wp_get_current_user();
            echo '<a href="link">Logout »</a> <a href="/messageboard/profile/">Change Profile »</a>' ;
         } else {
           echo '<a href="link">Login »</a>';
         }
    echo '</div></div>';
    return ob_get_clean();
    }
    add_shortcode( 'loginbar', 'login_bar' );

    Thanks for the help! Works great!

    Thread Starter anton1234

    (@anton1234)

    I’ll try that right away

    • This reply was modified 8 years, 9 months ago by anton1234.
    • This reply was modified 8 years, 9 months ago by anton1234.
    • This reply was modified 8 years, 9 months ago by anton1234.
    Thread Starter anton1234

    (@anton1234)

    Thanks for your reply, but I’m having trouble understanding what it is I need to do. I’m not familiar with PHP, that link doesn’t make a lot of sense to me.

    Thread Starter anton1234

    (@anton1234)

    I’m sorry for the bad aligning on the head post

    • This reply was modified 8 years, 9 months ago by anton1234.
Viewing 6 replies - 1 through 6 (of 6 total)