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 | |
### Function: Page Navigation | |
function wp_pagination($before = '', $after = '') { | |
global $wpdb, $wp_query; | |
if (!is_single()) { | |
$request = $wp_query->request; | |
$posts_per_page = intval(get_query_var('posts_per_page')); | |
$paged = intval(get_query_var('paged')); | |
$numposts = $wp_query->found_posts; |
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 | |
/** | |
* Retrieve the amount of comments a post has with russian plural form. | |
* | |
* @uses apply_filters() Calls the 'get_comments_number' hook on the number of comments | |
* | |
* @param int $post_id The Post ID | |
* @return int The number of comments a post has | |
*/ |
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
<form action="<?php bloginfo('url'); ?>" id="searchform" method="get"> | |
<div> | |
<input type="text" onblur="if (this.value == '') {this.value = 'Search';}" onfocus="if (this.value == 'Search') {this.value = '';}" id="s" name="s" value="Search"/> | |
<input type="submit" value="" id="ss"/> | |
</div> | |
</form> |
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 | |
/* | |
Template Name: Sitemap | |
*/ | |
?> | |
<?php get_header(); ?> | |
<div id="content"> | |
<div id="entry"> | |
<div class="post"> |
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 | |
/** | |
* Disable automatic generated Wordpress headers | |
*/ | |
// Disabling XMLRPC | |
add_filter('xmlrpc_enabled', '__return_false'); | |
// Remove WordPress Admin Bar | |
remove_action('init', 'wp_admin_bar_init'); |
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 | |
require_once(ABSPATH . 'wp-includes/class-snoopy.php'); | |
$tweet = get_option("lasttweet"); | |
$url = "http://twitter.com/statuses/user_timeline/mr_roose.json?count=20"; | |
if ($tweet['lastcheck'] < ( mktime() - 60 ) ) { | |
$snoopy = new Snoopy; | |
$result = $snoopy->fetch($url); | |
if ($result) { | |
$twitterdata = json_decode($snoopy->results,true); |
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 | |
function exclude_thumbnail_from_gallery($null, $attr) | |
{ | |
if (!$thumbnail_ID = get_post_thumbnail_id()) | |
return $null; // no point carrying on if no thumbnail ID | |
// temporarily remove the filter, otherwise endless loop! | |
remove_filter('post_gallery', 'exclude_thumbnail_from_gallery'); | |
// pop in our excluded thumbnail |
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 | |
function go_excerpt( $more ) { | |
return '...'; | |
} | |
add_filter( 'excerpt_more', 'go_excerpt' ); | |
function go_excerpt_length( $length ) { | |
return 30; | |
} | |
add_filter( 'excerpt_length', 'go_excerpt_length' ); |
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 | |
function remove_menus () { | |
global $menu; | |
$restricted = array(__('Links'), __('Posts')); | |
end ($menu); | |
while (prev($menu)){ | |
$value = explode(' ',$menu[key($menu)][0]); | |
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);} | |
} |
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 | |
function disable_default_dashboard_widgets() { | |
remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); | |
remove_meta_box('dashboard_plugins', 'dashboard', 'core'); | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); | |
remove_meta_box('dashboard_primary', 'dashboard', 'core'); | |
remove_meta_box('dashboard_secondary', 'dashboard', 'core'); |
OlderNewer