Skip to content

Instantly share code, notes, and snippets.

error_reporting(E_ALL); ini_set(‘display_errors’,1);
define(‘WP_DEBUG’, true);
@domantasg
domantasg / docker-compose.yml
Created May 25, 2017 06:41
docker-compose for WordPress and MySQL Containers
version: '2'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@domantasg
domantasg / Google Analytics Universal Tacking Code
Created May 29, 2017 12:51
Google Analytics Universal tracking code
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-00000000-1', 'auto');
ga('send', 'pageview');
</script>
@domantasg
domantasg / gist:2cdb90d01f4ca410e1cfafb819223c27
Created May 29, 2017 12:54
WordPress functions.php Google Analytics Fuction
add_action('wp_head','my_analytics', 20);
function my_analytics() {
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
version: '2'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
@domantasg
domantasg / style.css
Created June 6, 2017 14:11
Change WordPress background color
.site-content-contain {
background-color: #d5ffa0;
position: relative;
}
@domantasg
domantasg / WordPress Version Generator Meta Tag
Created June 15, 2017 08:36
Check which version of WordPress You are Running
<script type='text/javascript' src='http://hostinger-tutorials.com/wp-includes/js/jquery/jquery.js'></script>
<script type='text/javascript' src='http://hostinger-tutorials.com/wp-includes/js/jquery/jquery-migrate.min.js'></script>
<link rel='https://api.w.org/' href='http://hostinger-tutorials.com/wp-json/' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://hostinger-tutorials.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://hostinger-tutorials.com/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 4.8" />
class hstngr_widget extends WP_Widget {
//Insert 4 functions here
}
class hstngr_widget extends WP_Widget {
//Insert functions here
}