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 google_autoads() { | |
?> | |
[[insert your AdSense script here]] | |
<?php | |
} | |
add_action( 'wp_head', 'google_autoads' ); |
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 wikilinker_shortcode( $paras = '', $content = '' ) { | |
// Extract the shortcode parameters | |
extract( shortcode_atts( array( 'alt' => '', 'rel' => '', 'lang' => 'en', 'target' => '' ), $paras ) ); | |
// If an alternative link is specified use that rather than the linked text | |
if ( '' != $alt ) { $lookup = $alt; } else { $lookup = $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 | |
function get_the_shortlink() { | |
$post_id = get_the_ID(); | |
if ($post_id!="") {$shortlink=home_url()."/?p=".$post_id;} else {$shortlink="";} | |
return $shortlink; | |
} | |
?> |
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 skim_suppress( $paras = '', $content = '' ) { | |
return '<div class="noskim">'. do_shortcode( $content ) . '</div>'; | |
} | |
add_shortcode( 'noskim', 'skim_suppress' ); | |
?> |
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 pagerank_sc( $paras = '', $content = '' ) { | |
$cache_key = 'functions_pagerank'; | |
$cache = get_transient( $cache_key ); | |
if ( !$cache ) { | |
$fileout = wp_remote_get( 'http://prapi.net/pr.php?url=' . <code>get_site_url() </code>. '&f=text' ); |
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 post_count_sc( $paras = '', $content = '' ) { | |
return wp_count_posts() -> publish; | |
} | |
add_shortcode( 'post_count', 'post_count_sc' ); | |
?> |
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 get_cookies( $paras = '', $content = '' ) { | |
if ( strtolower( $paras[ 0 ] ) == 'novalue' ) { $novalue = true; } else { $novalue = false; } | |
if ( $content == '' ) { $seperator = ' : '; } else { $seperator = $content; } | |
$cookie = $_COOKIE; | |
ksort( $cookie ); |
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 check_plugin_status( $plugin_dir, $plugin_name = '' ) { | |
if ( '' == $plugin_name ) { $plugin_name = $plugin_dir . '.php'; } | |
if ( is_plugin_active( $plugin_dir . '/' . $plugin_name ) ) { | |
$status = 2; | |
} else { |
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 | |
add_filter( 'jetpack_relatedposts_filter_post_context', '__return_empty_string' ); | |
?> |
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 jrp_custom_image( $media, $post_id, $args ) { | |
if ( $media ) { | |
return $media; | |
} else { | |
$permalink = get_permalink( $post_id ); | |
$url = apply_filters( 'jetpack_photon_url', '[image url]' ); | |
return array( array( | |
'type' => 'image', |