Trying to write a function in an external php file to manage admin menu visibility

It’s becouse you’r calling alter_item function outside action admin_menu here’s working example i just made, try to figure what’s wrong with your’s by your self, if you fail i’ll explain add_action( ‘admin_menu’, ‘alter_items’ ); function alter_items() { global $current_user, $menu; get_currentuserinfo(); $scopes = apply_filters( ‘alter_items’, array() ); if( ! empty( $scopes ) ) { foreach( … Read more

how to stop wordpress admin menu from scrolling with page

The simplest solution I have for this, is in my themes function, or in a custom plugin file (if you have plugins you are working with) add this code: add_action( ‘admin_head’, ‘kaz_stop_sidescroll’ ); function kaz_stop_sidescroll(){ ?> <style type=”text/css”> #adminmenuwrap {position: relative!important;} </style> <?php } This will only add the styles to the admin area head … Read more

Multiple custom post types showing up in edit.php

The issue is that pre_get_posts runs on both the Front End and on the Admin Side unless you specifically tell it not to, here’s the function you supplied with a small twist: function pregp_archive_ppp_wpse_108225( $qry ) { if( is_admin() ) { return; } if( $qry->is_main_query() && $qry->is_archive() ) { $qry->set( ‘posts_per_page’, 5 ); $qry->set( ‘post_type’, … Read more

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