Skip to content

Instantly share code, notes, and snippets.

View robobobo's full-sized avatar

robobobo

View GitHub Profile
@robobobo
robobobo / .htaccess
Created March 14, 2018 12:59
HTACCESS file for Niall
# You can change, butdo not remove this header
#Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.gstatic.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' ; style-src 'self' data: 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; connect-src https: wss:;"
#
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
@robobobo
robobobo / gist:937e477ffaf59ea3f65762d3c5620d8a
Created February 19, 2018 19:34
How to add a div around Wordpress embeds using the oembed filter
function worpress_responsive_embeds($html)
{
if (stripos($html, "twitter") !== FALSE || stripos($html, "facebook") !== FALSE) {
return '<div class="social-embed-container">' . $html . '</div>';
}
else {
return '<div class="video-container">' . $html . '</div>';
}
}