<?php if ( ! defined( 'ABSPATH' ) ) exit;define( 'GPC_VERSION', '1.0.0' );show_admin_bar( false );add_action( 'wp_enqueue_scripts', 'gpc_scripts' );function gpc_scripts(){wp_enqueue_style( 'gpc-base', get_stylesheet_directory_uri() . '/css/base.css', false, GPC_VERSION, 'all');wp_enqueue_style( 'gpc-gutenberg', get_stylesheet_directory_uri() . '/css/gutenberg.css', false, GPC_VERSION, 'all');wp_enqueue_script( 'gpc-scripts', get_stylesheet_directory_uri() . '/js/scripts.js', '', GPC_VERSION, true );// register block styles and scripts
wp_register_style( 'gpc-team-styles', get_stylesheet_directory_uri() . '/template-parts/blocks/team/team.css', false, GPC_VERSION, 'all')}add_action( 'admin_enqueue_scripts', 'gpc_admin_scripts' );function gpc_admin_scripts(){wp_enqueue_style( 'gpc-editor', get_stylesheet_directory_uri() . '/admin/css/editor.css', false, GPC_VERSION, 'all');// register block styles and scripts
wp_register_style( 'gpc-team-admin-styles', get_stylesheet_directory_uri() . '/template-parts/blocks/team/team.css', false, GPC_VERSION, 'all')}add_action( 'enqueue_block_editor_assets', 'gpc_gutenberg_scripts' );function gpc_gutenberg_scripts(){// Load editor scripts for all post types
wp_enqueue_script( 'gpc-editor', get_stylesheet_directory_uri() . '/admin/js/editor.js', array( 'wp-blocks', 'wp-dom' ), GPC_VERSION, true );// Load editor scripts for specific post types
global $current_screen;if ( $current_screen->post_type == 'post' ){wp_enqueue_script( 'gpc-editor-post', get_stylesheet_directory_uri() . '/admin/js/editor-post.js', array( 'wp-blocks', 'wp-dom' ), GPC_VERSION, true )}}register_block_type( __DIR__ . '/blocks/team/block.json' );add_action( 'init',function(){remove_theme_support( 'core-block-patterns' )}, 9 );add_theme_support( 'wp-block-styles' );add_theme_support( 'editor-styles' );add_editor_style( 'css/gutenberg.css' );add_filter( 'body_class', 'gpc_body_classes' );function gpc_body_classes( $classes ){$classes[] = 'gpc';return $classes}add_action( 'generate_before_header','gpc_add_js_class' );function gpc_add_js_class(){?>
<script>
const htmlEl = document.documentElement;htmlEl.classList.add('has-js');</script>
<?php}// add_filter( 'widget_text' , 'do_shortcode' );add_post_type_support( 'page', 'excerpt' );//add_filter( 'enter_title_here', 'gpc_change_title_text' );function gpc_change_title_text( $title ){$screen = get_current_screen();if ( 'staff' == $screen->post_type ){$title = 'Enter staff name here'}return $title}// add_action( 'template_redirect', 'gpc_remove_wp_archives' );function gpc_remove_wp_archives(){//If we are on category or tag or date or author archive
if( is_category() || is_tag() || is_date() || is_author() ){global $wp_query;$wp_query->set_404();//set to 404 not found page}}add_action( 'template_redirect', 'gpc_disable_author_page' );function gpc_disable_author_page(){global $wp_query;if ( is_author() ){// Redirect to homepage, set status to 301 permenant redirect.
wp_redirect( get_option('home'), 301 );exit}}add_filter( 'rest_authentication_errors', function( $result ){if ( ! empty( $result ) ){return $result}if ( ! is_user_logged_in() ){return new WP_Error( 'rest_not_logged_in', 'You are not currently logged in.', array( 'status' => 401 ) )}if ( ! current_user_can( 'administrator' ) ){return new WP_Error( 'rest_not_admin', 'You are not an administrator.', array( 'status' => 401 ) )}return $result});remove_action( 'wp_head', 'wp_generator' );require get_stylesheet_directory() . '/inc/helper-functions.php';require get_stylesheet_directory() . '/inc/users.php';require get_stylesheet_directory() . '/inc/generatepress.php';// require get_stylesheet_directory() . '/inc/colors.php';// should be before styles.php to access colors
// require get_stylesheet_directory() . '/inc/styles.php';// require get_stylesheet_directory() . '/inc/fonts.php';// require get_stylesheet_directory() . '/inc/generateblocks.php';require get_stylesheet_directory() . '/inc/login.php';require get_stylesheet_directory() . '/inc/dashboard-widgets.php';require get_stylesheet_directory() . '/inc/widgets.php';require get_stylesheet_directory() . '/inc/sub-menu.php';// require get_stylesheet_directory() . '/inc/sub-menu-widget.php';// require get_stylesheet_directory() . '/inc/breadcrumbs.php';require get_stylesheet_directory() . '/inc/optimizations.php';require get_stylesheet_directory() . '/inc/image-sizes.php';// require get_stylesheet_directory() . '/inc/wp-show-posts.php';// require get_stylesheet_directory() . '/inc/cpt-output-custom.php';// require get_stylesheet_directory() . '/inc/advanced-custom-fields.php';// require get_stylesheet_directory() . '/inc/woocommerce.php';require get_stylesheet_directory() . '/inc/shortcodes.php';<?php}