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
add_filter('wp_nav_menu_items','add_search_box', 10, 2); | |
function add_search_box($items, $args) { | |
ob_start(); | |
get_search_form(); | |
$searchform = ob_get_contents(); | |
ob_end_clean(); | |
$items .= '<li>' . $searchform . '</li>'; | |
return $items; | |
} |
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 disable_self_ping( &$links ) { | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, get_option( 'home' ) ) ) | |
unset($links[$l]); | |
} | |
add_action( 'pre_ping', 'disable_self_ping' ); |
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 wdc_no_more_jumping($post) { | |
return '<a href="'.get_permalink($post->ID).'" class="read-more">'.'Continue Reading'.'</a>'; | |
} | |
add_filter('excerpt_more', 'wdc_no_more_jumping'); |
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 | |
include_once(ABSPATH.WPINC.'/rss.php'); | |
$googleplus = fetch_feed("http://plusfeed.appspot.com/123456789..."); // Replace 123456789... by your own ID | |
echo '<a href="'; | |
echo $googleplus->items[0]['link']; echo '">'; | |
echo $googleplus->items[0]['summary']; | |
echo ''; | |
?> |
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 include_once(ABSPATH.WPINC.'/rss.php'); | |
wp_rss('http://wpforums.com/external.php?type=RSS2', 5); ?> |
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_filter('widget_text', 'do_shortcode') ?> |
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 | |
function additional_post_classes( $classes ) { | |
global $wp_query; | |
if( $wp_query->found_posts < 1 ) { | |
return $classes; | |
} | |
if( $wp_query->current_post == 0 ) { | |
$classes[] = 'post-first'; |
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 | |
function my_init() { | |
add_post_type_support('page', array('excerpt')); | |
} | |
add_action('init', 'my_init'); | |
?> |
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_theme_support( 'post-thumbnails' ); | |
// This adds support for pages only: | |
add_theme_support( 'post-thumbnails', array( 'page' ) ); | |
// And this adds support for posts only: | |
add_theme_support( 'post-thumbnails', array( 'post' ) ); | |
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 | |
// Find: | |
foreach ($comments as $comment) : | |
// Comments are displayed here | |
endforeach; | |
?> | |
<?php | |
// And replace with: | |
?> |
NewerOlder