This file contains 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
add_action('admin_head', 'so_excerpt_textarea_height'); | |
function so_excerpt_textarea_height() { | |
echo' | |
<style type="text/css"> | |
#excerpt{ height:500px; } | |
</style> | |
'; | |
} |
This file contains 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 URL field from comment form | |
function so_remove_comment_fields($fields) { | |
unset($fields['url']); | |
return $fields; | |
} | |
add_filter('comment_form_default_fields','so_remove_comment_fields'); |
This file contains 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
// ADD SEARCH BOX TO NAVIGATION | |
function so_add_search_box($items, $args) { | |
ob_start(); | |
get_search_form(); | |
$searchform = ob_get_contents(); | |
ob_end_clean(); | |
$items .= '<li class="nav_search">' . $searchform . '</li>'; | |
return $items; | |
} | |
add_filter('wp_nav_menu_items','so_add_search_box', 10, 2); |
This file contains 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
// Enable for widget title | |
add_filter('widget_title', 'do_shortcode'); | |
// Enable for widget text | |
add_filter('widget_text', 'do_shortcode'); | |
// don't auto-wrap shortcode that appears on a line of it's own | |
add_filter( 'widget_text', 'shortcode_unautop'); |
This file contains 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
//disable auto updating of WP since 3.7 | |
//Disables all core updates: | |
define( 'WP_AUTO_UPDATE_CORE', false ); | |
//Enables all core updates, including minor and major: | |
define( 'WP_AUTO_UPDATE_CORE', true ); | |
//Enables core updates for minor releases (default): | |
define( 'WP_AUTO_UPDATE_CORE', 'minor' ); | |
//only disable updating of the wp.content folder, i.e. no themes and default plugins like akismet and hello dolly |
This file contains 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
// show post thumbnails in feeds | |
function diw_post_thumbnail_feeds($content) | |
{ | |
global $post; | |
if(has_post_thumbnail($post->ID)) | |
{ | |
$content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content; | |
} | |
return $content; | |
} |
This file contains 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 //just need to research the type for each ending | |
function addUploadMimes($mimes) { | |
$mimes = array_merge($mimes, array( | |
'pdf|xls|tmPreferences' => 'application/octet-stream' | |
)); | |
return $mimes; | |
} | |
?> | |
add_filter('upload_mimes', 'addUploadMimes'); |
This file contains 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
add_filter('excerpt_length', 'my_excerpt_length'); | |
function my_excerpt_length($length) { | |
if(in_category(14)) { | |
return 13; | |
} else { | |
return 60; | |
} | |
} |
This file contains 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 $loop = new WP_Query( array( 'post_type' => 'movies','actors' => 'peter-smith', 'actress' => 'jane-smith', 'posts_per_page' => 10 ) ); ?> | |
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?> | |
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?> | |
<h5>image</h5><a href="<?php the_permalink(); ?>"><img src="<?php the_field('image'); ?>" alt="text-here" /></a> | |
<?php the_excerpt(); ?> | |
<?php endwhile; ?> |
This file contains 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 wpbeginner_comment_text_after($arg) { | |
$arg['comment_notes_after'] = "We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our <a href='http://www.example.com/comment-policy-page/'>comment policy</a>."; | |
return $arg; | |
} | |
add_filter('comment_form_defaults', 'wpbeginner_comment_text_after'); |