Do not add content filter on page template

ok here is the answer.. pheww function oswc_formatter($content) { if( is_page_template( ‘template-flat.php’ ) ) { return $content; }else{ $new_content=””; /* Matches the contents and the open and closing tags */ $pattern_full=”{(\[raw\].*?\[/raw\])}is”; /* Matches just the contents */ $pattern_contents=”{\[raw\](.*?)\[/raw\]}is”; /* Divide content into pieces */ $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); /* Loop over pieces */ … Read more

Add custom function to a theme with child theme’s functions.php

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; } … Read more