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
/style.less | |
/style.css | |
/lessc.php | |
/lessc.inc.php |
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
<? | |
require "lessc.inc.php"; | |
$less = new lessc; | |
$less->compileFile("style.less", "style.css"); | |
?> | |
<style>code { animation: fadein 2s } | |
@keyframes fadein { from { opacity:0 } to { opacity:1 } }</style> | |
<code>Compiled: <?= date('r') ?></code> |
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
# Redirect non-www urls to www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com/$ | |
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L] | |
# Redirect www urls to non-www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ | |
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L] |
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 return_a_damn_image() { | |
global $post; | |
// try to get featured image | |
$ftr = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID()), 'medium' ); | |
// try to get posts from post_content | |
preg_match_all('/< *img[^>]*src *= *["\']?([^"\']*)/i',$post->post_content, $result); | |