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 | |
| /** | |
| * Add a Character Counter to Excerpt box in Edit Post screen. | |
| * | |
| * Includes suggested range. | |
| * Char-count number is color red when outside range and green within. | |
| * | |
| * @link http://wpsites.org/add-character-counter-excerpt-box-10503/ | |
| */ | |
| function my_excerpt_count_js() { |
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 | |
| /* Add image data column to Media Library */ | |
| /** | |
| * Add columns (file-size) to the Media Library list table. | |
| * | |
| * @param array $posts_columns Existing array of columns displayed in the Media list table. | |
| * @return array Amended array of columns to be displayed in the Media list table. | |
| */ | |
| function my_media_columns( $posts_columns ) { | |
| $posts_columns['size'] = __( 'Size', 'headecon' ); |
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 | |
| echo $check_fn = ( function_exists( 'http_parse_message' ) ) ? 'yo' : 'no'; | |
| echo ' '; | |
| echo $check_ext = ( extension_loaded( 'pecl_http' ) ) ? 'yo' : 'no'; | |
| if ( class_exists('My_Class') ) { | |
| $my_class = new My_Class(); | |
| } | |
| echo 'Current PHP version: ' . phpversion(); |
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 | |
| /* Add body-class for top-level parent Page or Category */ | |
| function topcatpg_body_class( $class ) { | |
| $prefix = 'topic-'; // Editable class name prefix. | |
| $top_cat_pg = 'home'; // Default. | |
| global $top_cat_pg; | |
| // Get class name from top-level Category or Page. | |
| global $wp_query; | |
| if ( is_single() ) { |
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 | |
| /** | |
| * Use filemod timestamp for version number. | |
| * | |
| * For setting cache-busting version number in script registrations. Usage: | |
| * wp_register_script( 'handle', $file_url, array(), headecon_filemod_vers( $file_path ) ); | |
| * | |
| * @param string $path Path of script/style file | |
| * @return string $vers File-modification timestamp or WordPress version | |
| */ |
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 | |
| $query_images_args = array( | |
| 'post_type' => 'attachment', | |
| 'post_status' => 'inherit', | |
| 'posts_per_page' => -1, | |
| ); | |
| $query_images = new WP_Query( $query_images_args ); | |
| $image_sizes = get_intermediate_image_sizes(); | |
| $image_sizes[] = 'full'; |
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 | |
| /* WordPress debug globals (goes in wp-config.php). | |
| * For Dev sites only! | |
| * @ link https://premium.wpmudev.org/blog/debugging-wordpress-how-to-use-wp_debug/ | |
| */ | |
| // Turn debugging on. | |
| define( 'WP_DEBUG', true ); | |
| // Log PHP error messages to file: /wp-content/debug.log | |
| define( 'WP_DEBUG_LOG', true ); |
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 | |
| /** | |
| * This changes logging to only log fatal errors. This file should go in your mu-plugins directory. | |
| */ | |
| // Set the error logging to only log fatal errors | |
| error_reporting( E_ERROR ); | |
| // Optional: change the location of your error log, it might be wise to put it outside your WP content dir. | |
| // If you don't change it, the default place for this log is debug.log in your WP_CONTENT_DIR. |
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
| <script type="application/ld+json">{ | |
| "@context": "https://schema.org", | |
| "@graph": [ | |
| { | |
| "@type": "Organization", | |
| "@id": "https://example.com/#organization", | |
| "name": "Yoast", | |
| "url": "https://example.com/", | |
| "sameAs": [ | |
| "https://www.facebook.com/yoast", |