This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined( 'ABSPATH' ) or header( 'Location: /' ); | |
| /** | |
| * Helper and utility functions | |
| */ | |
| /** | |
| * Get only excerpt content, not post intro | |
| */ | |
| function get_only_the_excerpt() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Admin login form | |
| */ | |
| add_action('login_enqueue_scripts', function() { | |
| $upload_dir = wp_upload_dir(); | |
| echo '<style>#login h1 a, .login h1 a {background-image:url('.$upload_dir['baseurl'].'/site/login.svg);background-size:72px}</style>'; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Yup... really the only way... display:none | |
| */ | |
| add_action('admin_head', 'remove_edit_profile_fields_css'); | |
| function remove_edit_profile_fields_css() { | |
| echo "<style> | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Cleanup WP admin and unwanted code... | |
| */ | |
| // Remove actions | |
| remove_action('welcome_panel', 'wp_welcome_panel'); | |
| remove_action('dashboard_primary', 'wp_dashboard_primary'); | |
| remove_action('admin_color_scheme_picker', 'admin_color_scheme_picker'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Additional option pages | |
| * | |
| * @uses Advanced Custom Fields | |
| * @see https://www.advancedcustomfields.com/resources/get-values-from-an-options-page/ | |
| */ | |
| if(function_exists('acf_add_options_page')) { | |
| acf_add_options_sub_page(array( | |
| 'page_title' => 'Additional Options', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Fix search when using smart quotes. Downgrade to straight double quotes. | |
| */ | |
| add_filter('pre_get_posts', 'filter_smart_quote_queries', 10, 1); | |
| add_action('pre_get_posts', 'exclude_posts_from_search'); | |
| /** | |
| * Add custom fields data to global WP search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Gravity forms | |
| */ | |
| add_filter('gform_init_scripts_footer', '__return_true'); | |
| add_filter('gform_disable_print_form_scripts', '__return_true'); | |
| /** | |
| * Force Gravity forms to init scripts in the footer... | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * HTML document compression | |
| * | |
| * Clean and minify all markup | |
| * Wrap `<!--no compression-->` to skip over content | |
| */ | |
| class WP_HTML_Compression { | |
| protected $compress_css = true; // Compress all inline styles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Yoast SEO Add additional separators to %sep% | |
| * Needed to add pipe "|" back since v17.1 | |
| */ | |
| add_filter('wpseo_separator_options', function($separators) { | |
| $additional = array('|'); | |
| $separators = array_unique(array_merge($separators, $additional)); | |
| return $separators; | |
| }, 10 , 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * Register cpt post type | |
| * `cpt` | |
| */ | |
| function cpt_init() { | |
| $name = 'cpt'; | |
| $type = sanitize_title($name); | |
| $labels = array( |
NewerOlder