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 if ( has_post_thumbnail() ) { | |
| the_post_thumbnail(); | |
| } else { ?> | |
| <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> | |
| <?php } ?> |
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 if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { | |
| echo get_the_post_thumbnail($post->ID); | |
| } else { | |
| echo main_image(); | |
| } ?> |
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
| // REMOVE POST META BOXES | |
| function remove_metaboxes() { | |
| /* Posts */ | |
| remove_meta_box( 'authordiv','post','normal' ); // Author Metabox | |
| remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Status Metabox | |
| remove_meta_box( 'commentsdiv','post','normal' ); // Comments Metabox | |
| remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox |
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
| remove_action('wp_head', 'wp_generator'); |
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
| /************************************************************************* | |
| The following function takes two parameters: | |
| $string – The string that needs be limited for example get_the_excerpt(). | |
| $max_words – The maximum amount of words you would like to show. | |
| ***************************************************************************/ | |
| /* Limit Your Website Excerpt */ | |
| function word_limit($string, $max_words){ |
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
| function custom_excerpt_length( $length ) { | |
| return 20; | |
| } | |
| add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
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
| /* Search Everything*/ | |
| function SearchFilter($query) { | |
| $post_type = $_GET['post_type']; | |
| if (!$post_type) { | |
| $post_type = 'any'; | |
| } | |
| if ($query->is_search) { | |
| $query->set('post_type', $post_type); | |
| }; | |
| return $query; |