anton1234
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Give editor access to theme’s menuTo 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?
Forum: Fixing WordPress
In reply to: Give editor access to theme’s menuAlso 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.
Forum: Developing with WordPress
In reply to: Creating a shortcode that inserts codeMy 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!
Forum: Developing with WordPress
In reply to: Creating a shortcode that inserts codeForum: Developing with WordPress
In reply to: Creating a shortcode that inserts codeThanks 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.
Forum: Developing with WordPress
In reply to: Creating a shortcode that inserts codeI’m sorry for the bad aligning on the head post
- This reply was modified 8 years, 9 months ago by anton1234.