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 | |
if ( isset( $_GET['author'] ) || ( $_GET['author'] != $current_user->ID ) ) | |
$location = remove_query_arg('author', $location); | |
$location = add_query_arg( 'author', $current_user->ID, $location); | |
wp_redirect($location); | |
exit(); | |
?> |
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 | |
class DATABASE_CONFIG { | |
var $default = array( | |
'driver' => 'mysql', | |
'persistent' => false, | |
'host' => 'localhost', | |
'login' => 'user_name', | |
'password' => 'your_password', | |
'database' => 'database_name', | |
'prefix' => '', |
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 get_google_plus1_count($url) | |
{ | |
$ch = curl_init(); | |
curl_setopt_array($ch, array( | |
CURLOPT_HTTPHEADER => array('Content-type: application/json'), | |
CURLOPT_POST => true, | |
CURLOPT_POSTFIELDS => '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"'.$url.'","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_SSL_VERIFYPEER => false, | |
CURLOPT_URL => 'https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ' |
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
@font-face { | |
font-family: 'Open Sans'; | |
font-style: italic; | |
font-weight: 400; | |
src: local('Open Sans Italic'), local('Open-Sans-Italic'), | |
url('OpenSans-Italic.woff') format('woff'), | |
url('OpenSans-Italic.ttf') format('truetype'); | |
} | |
@font-face { |
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 html5_video( $atts, $content = NULL ) { | |
extract( shortcode_atts( array( | |
"src" => '', | |
"width" => '', | |
"height" => '' | |
), $atts ) ); | |
return '<video src="' . $src . '" width="' . $width . '" height="' . $height . '" controls autobuffer>'; | |
} | |
add_shortcode( 'video5', 'html5_video' ); | |
Now you can use the following shortcode in your 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 | |
/* | |
* Footer menu walker - just because wordpress sucks | |
* See wp-includes/class-wp-walker.php for what the hell this does normally (Class Walker) | |
*/ | |
class footer_menu_walker { | |
/* | |
Output we are aiming for: | |
<div class="col"> | |
<h3>Some sub menu</h3> |
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 | |
/** | |
* Open Graph Tags | |
* | |
* Add Open Graph tags so that Facebook (and any other service that supports them) | |
* can crawl the site better and we provide a better sharing experience. | |
* | |
* @link http://ogp.me/ | |
* @link http://developers.facebook.com/docs/opengraph/ | |
*/ |
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( 'body_class' , 'ft_add_guest_body_class' ); | |
/** | |
* Adds a body class for guests. | |
* | |
* @author Remkus de Vries | |
* @link http://remkusdevries.com/when-sharing-wordpress-related-code-snippets-i-can-haz-standards-please/ | |
* @param array $classes Existing body classes | |
* @return array Amended body classes |
OlderNewer