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 | |
/* | |
Plugin Name: Test | |
*/ | |
class My_Like_Button { | |
function __construct() | |
{ | |
$this->hooks(); | |
} |
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
.slider-container { | |
width: 600px; | |
height: 200px; | |
overflow: hidden; | |
position: relative; | |
} | |
.slider ul, .slider li { | |
margin: 0; | |
padding: 0; | |
list-style: none; |
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
body *[class] { | |
position:relative; | |
border:1px dashed #ccc; | |
} | |
body *[class]::before { | |
content:attr(class); | |
line-height:10px; | |
color:#fff; | |
font-size:9px; | |
font-family:sans-serif; |
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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
ul { float:left; margin-right:20px; } | |
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); } | |
ul { width:512px; overflow:hidden; border-radius:6px; } |
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("the_content", "the_content_filter"); | |
function the_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join("|",array("col","shortcode2","shortcode3")); | |
// opening tag |
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 | |
/* | |
* Resize images dynamically using wp built in functions | |
* Victor Teixeira | |
* | |
* php 5.2+ | |
* | |
* Exemplo de uso: | |
* | |
* <?php |
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 | |
// Here we are, in any scope imaginable. It doesn't matter which | |
$my_object = new My_Class(); | |
add_filter( 'jpb.provider.my_class', function() use ( $my_object ) { | |
return $my_object || new My_Class(); | |
} ); | |
// This is in the global scope |
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 | |
// Filter JPEG compression | |
add_filter('jpeg_quality', function($arg) { return 100; }); | |
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
backend default { | |
.host = "127.0.0.1"; | |
.port = "8444"; | |
} | |
sub vcl_recv { | |
# Allow the back-end to serve up stale content if it is responding slowly. | |
set req.grace = 2m; |
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
/* In functions.php */ | |
function my_theme_get_post_format_image_src($post_id){ | |
$format_meta = get_post_format_meta($post_id); | |
$match = array(); | |
preg_match('/<img.*?src="([^"]+)"/s', $format_meta['image'], $match); | |
return $match[1]; | |
} | |
/* In the template file */ | |
$image_src = my_theme_get_post_format_image_src($post->ID); |
OlderNewer