I think the problem is with your choice of hook and conditional statement. Try init and remove the !.
function themeblvd_disable_admin_bar() {
if( current_user_can('edit_posts') )
add_filter('show_admin_bar', '__return_false');
}
add_action( 'init', 'themeblvd_disable_admin_bar' );
Looks like your conditional is also wrong for the redirect
function themeblvd_redirect_admin(){
if ( current_user_can( 'edit_posts' ) ){
wp_redirect( site_url() );
exit;
}
}
add_action( 'admin_init', 'themeblvd_redirect_admin' );
If these snippets work as tested please mark this answer as accepted and up vote using the arrows to the left. Thanks
Related Posts:
- get_template_directory_uri pointing to parent theme not child theme
- Child theme – Overriding ‘require_once’ in functions.php
- Include files in child theme functions file
- Redeclare a function in a child theme
- How to override a function when isn’t at functions.php
- One Child Functions.php for Multiple Child Themes
- Removing custom background and header feature in child theme
- How to override function in functions.php of parent theme?
- Implementing DNS Prefetching with WordPress
- override parent theme configuration in child functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- syntax for remove_filter in parent theme with class
- How to override functions.php in child theme?
- Override parent theme function that is not hooked or in the functions.php file
- Function in Child Theme not overriding Parent Theme function [duplicate]
- I created a child theme and it doesn’t work for some of the css files
- Child Theme Not Overriding Parent Theme
- Overriding methods in a child theme
- How to override enqueued styles using a child theme
- Using the child theme functions.php to change the customizer.php on parent theme
- Child theme functions.php not executing
- How to store / access files in child theme folder
- Make “sidebar template” the default template for new pages
- override parent theme configuration in child functions.php
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Twenty Eleven Child theme error when attempting to use a rewritten function
- How do I get a child theme to load scripts from the parent theme?
- how to edit functions.php in a child theme
- Best practice when altering a parent theme function inside a child theme?
- How to make child theme inherit parent custom theme options [closed]
- Avoid loading css from parent theme
- Creating a child theme – functions.php code issue
- Overwriting Parent Theme’s Image Sizes
- Problem only while using require_once() within functions.php
- Twentyten Child Theme: header images display messed up in admin panel
- Why is functions.php file in child not initializing and over-writing parent?
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Reuse variable in hook callback
- Automatically include all php files in a child theme directory
- Override the function twentytwelve_scripts_styles in a child theme
- Pagination in relation to archive.php
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- How to load parent theme template parts in child theme
- Running script based on Category
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Not all CSS elements transferring via parent to child?
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Return child theme url
- Got white blank page after copying the functions.php to child theme
- How do I change a parent theme’s function through the child theme?
- Randomizing wp_tag_cloud() in child theme
- Add back in child theme what the parent theme removed with remove_action
- Can’t switch to a child theme using filters template, option_template and option_stylesheet
- Where do I go to edit this area? [closed]
- How to include any template using Shortcode fuction?
- Parent theme styles overriding child theme CSS [closed]
- overwrite code snippet from parent to child theme
- Child theme function.php causes fatal error
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- How to remove admin footer text from inside child theme?
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- How to overwrite template.php file
- remove_action not working, even after changing priority [duplicate]
- Solution dealing with Child Theme / Parent theme functions
- Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme
- How to use parent theme functions in child theme functions.php file?
- Removing parent theme CSS without editing parent theme
- How to override this theme function in child theme
- Child theme functions.php
- Change custom featured image size in twentythirteen child theme
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- Looking for Functions File that doesn’t Exist
- Include widget file in functions.php of child theme
- how can I add filter in specfic field in my website?
- How to remove font awesome from loading in wp theme
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Add Javascript code to functions.php childtheme
- Widget is displayed in two places
- How to add javascript code into Divi child theme?
- Replace theme function
- Change default color scheme in twentyfifteen child theme?
- How would I correctly implement a new if statement in a child functions file?
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Child Theme not loading multiple stylesheets
- Including admin-options.php file in Child Themes
- uninstall a theme programmaticlly
- Getting back a blank WordPress site following functions code edit
- Adding a meta box fields to child theme options page
- Update add_image_size
- Load a Child Theme’s style.css just before the closing tag
- Is it possible to change parameters of Parent theme function in the Child theme?
- Blank child theme – functions.php problem
- Functions.php in child theme that loads CSS file breaks website
- unregister_sidebar in child theme not working
- Unregistering custom tinymce plugin?
- Child Theme not working – CSS gone
- How do I make my child theme’s CSS update when I save it?
- How to fix enqueue_styles error for a twenty-seventeen childtheme
- post_row_actions filter from parent theme not executing in child theme