Remove Menu Page Giving Error

Put the add_action line inside the if (!current_user_can(‘activate_plugins’) ) {: <?php /************ Remove admin menu items from anyone who isn’t an admin ************/ if (!current_user_can(‘activate_plugins’) ) { function my_remove_menu_pages() { remove_menu_page(‘link-manager.php’); remove_menu_page(‘tools.php’); remove_menu_page(‘edit-comments.php’); } add_action( ‘admin_menu’, ‘my_remove_menu_pages’ ); }; ?>

500 Internal Server Error after Register dialog, but with successful registration

Internal Server errors are usually thrown when there’s an error somewhere in the code. You did the right thing searching the logs, but depending on your hosting configuration not all errors can be written there. I like using WordPress’s own logging facility. Here’s what you need to do: Stick the following lines in your wp-config.php … Read more

418 header status, I’m a teapot [closed]

You were right Toscho, it is a plugin called ‘better WP-Security’ I did a search for ‘418’ as suggested in the files I had backed up via ftp and found this: $bwpsmemlimit = (int) ini_get( ‘memory_limit’ ) //if they’re locked out or banned die if ( ( $bwpsoptions[‘id_enabled’] == 1 ||$bwpsoptions[‘ll_enabled’] == 1 ) && … Read more

“Notice: Undefined index:” error when adding new content?

Whoever wrote your theme didn’t bother to verify the existence of array keys before using them. The error is happening because the key album_tracks_metabox_nonce doesn’t exist in the $_POST array. The line likely should be: if ( !isset($_POST[‘album_tracks_metabox_nonce’]) || !wp_verify_nonce($_POST[‘album_tracks_metabox_nonce’], ‘album_tracks_metabox’) ) { // whatever is in the if condition, likely `return` }

Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template

Replacing all the specific the_content() functions, or the_ID… etc by the getters equivalent seems to fix the problem. Here the solution: <?php $o = array(); $o[ ‘title’ ] = wp_title( ‘|’, false, ‘right’ ); $o[ ‘type’ ] = ‘single-project’; //ob_start(); $article=”<div id=”container” class=”content-area project-content”>”; $article .= ‘<main id=”main” class=”site-main” role=”main”>’; while (have_posts()) : the_post(); $article … Read more

Error messages when adding code to function.php or trying to delete inactive plugin files

Your functions.php file is outputting instead of returning something, on line 519. Can you post whatever code/functions are around Line 519? EDIT: You have a syntax error in your cpt_Search_category_Filter() function. You have a couple stray semi-colons after closing braces. Change this: function cpt_Search_category_Filter($query) { $post_type = array(‘post’,’business_sold’); if ($query->is_search || $query->is_category) { $query->set(‘post_type’, $post_type); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)