Skip to content

Instantly share code, notes, and snippets.

View jondueck's full-sized avatar

Jon Dueck jondueck

View GitHub Profile
@jondueck
jondueck / Install Facebook Page Tab Address
Created April 21, 2014 21:24
Install Facebook Page Tab
https://www.facebook.com/dialog/pagetab?app_id=[APP [ID]&next=[PROJECT URL]
For example, if your app ID is 189112594552990 and your project URL is https://entertowin.projects.fm you should point to https://www.facebook.com/dialog/pagetab?app_id=189112594552990&next=https://entertowin.projects.fm .
@jondueck
jondueck / .htaccess gzip
Last active August 29, 2015 14:06
gzip
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/svg+xml
</ifmodule>
# END GZIP
@jondueck
jondueck / Bear Kaomoji
Created December 23, 2014 20:16
Emoticons featuring Bears and the text replacement codes I use
:bearhug: ʕっ•ᴥ•ʔっ
:bearlook: ʕ ◔ᴥ◔ ʔ
:bearmad: ʕ≧ᴥ≦ʔ
:bearok: ٩ʕ•̤̀ᴥ•̤́๑ʔᵒᵏᵎᵎᵎᵎ
:bearpoint: ☜ ʕ•ᴥ•ʔ ☞
:bearRIP: ʕ˼●̙̂ ̟ ̟̎ ̟ ̘●̂˻ʔ
:bears: ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
:bearshrug: ¯\_ʕ•ᴥ•ʔ_/¯
:bearstrong: ᕦʕ•ᴥ•ʔᕤ
:bearsurprise: ʕ´•ᴥ•`ʔ
@jondueck
jondueck / -> functions.php
Last active August 29, 2015 14:14
Function to remove inline-styling from wp-caption
add_shortcode('wp_caption', 'fixed_img_caption_shortcode');
add_shortcode('caption', 'fixed_img_caption_shortcode');
function fixed_img_caption_shortcode($attr, $content = null) {
if ( ! isset( $attr['caption'] ) ) {
if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
$content = $matches[1];
$attr['caption'] = trim( $matches[2] );
}
}
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
@jondueck
jondueck / image.php
Created February 20, 2015 20:11
Disable Wordpress image pages and redirect to parent page
<?php wp_redirect(get_permalink($post->post_parent)); ?>
@jondueck
jondueck / .htaccess
Created February 23, 2015 14:30
Remove www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]
@jondueck
jondueck / urlencode the_permalink
Created February 27, 2015 01:23
Encode permalinks in Wordpress
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
@jondueck
jondueck / .htaccess
Last active October 29, 2015 15:07
htaccess Starter
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/svg+xml image/x-icon
</ifmodule>
# END GZIP