Skip to content

Instantly share code, notes, and snippets.

View mariadanieldeepak's full-sized avatar

Maria Daniel Deepak mariadanieldeepak

View GitHub Profile
function my_theme_remove_optins() {
wp_enqueue_script( 'remove-optin', 'remove-optin.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ) );
}
add_action( 'wp_enqueue_scripts', 'my_theme_remove_optins' );
function my_theme_remove_optins() {
if ( is_user_logged_in() ) {
wp_enqueue_script( 'remove-optin', 'remove-optin.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ) );
} elseif ( wp_script_is( 'remove-optin', 'enqueued' ) ) {
// This check is needed to show the Optin.
wp_dequeue_script( 'remove-optin' );
}
}
add_action( 'wp_enqueue_scripts', 'my_theme_remove_optins' );
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 300x250_sidebar -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-1XXXXXXXXXXXXXXX"
data-ad-slot="4XXXXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<?php
// Add the following snippet to your functions.php file.
function my_google_adsense() {
wp_enqueue_script( 'my-google-adsense-js', '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', array(), false, false );
}
add_action( 'wp_enqueue_scripts', 'my_google_adsense' );
// Use the following code your WordPress widget
// If you're using WordPress 4.8 or 4.8+, make sure to switch to Text mode in Text widgets.
<!-- 300x250_sidebar -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-1XXXXXXXXXXXXXXX"
data-ad-slot="4XXXXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
function add_async_attribute( $tag, $handle ) {
if ( 'my-google-adsense-js' !== $handle) {
return $tag;
} else {
return str_replace(' src', ' async="async" src', $tag);
}
}
apply_filters( 'script_loader_tag', 'add_async_attribute' );
@mariadanieldeepak
mariadanieldeepak / system-info.txt
Created October 27, 2017 10:40
WP Search System Info
### Begin System Info ###
## Please include this information when posting support requests ##
Multisite: No
SITE_URL: https://breakingintowallstreet.com/biws
HOME_URL: https://breakingintowallstreet.com/biws
@mariadanieldeepak
mariadanieldeepak / vagrant-up-error.sh
Created November 24, 2017 03:51
Facing vm: a box must be specified issue?
➜ vvv git:(develop) ✗ vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* A box must be specified.
@mariadanieldeepak
mariadanieldeepak / id_rsa.pub
Created November 30, 2017 05:48
Daniel's Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDJO4loiCfAZ015t8Lh7pc2ZO/Dq5F2YGKB63YgyQtdV7jJ/GkspH7bmGBtEdfaE9kLzySLsTdxYaTTbkpUJOkc9p29Ufv9ksx3eF78t2LwbLxZIz51R/AAP5GDvChAxq3VwajHE2QrovxqXzxuqa0PiWNrLjVaG1Uzp8azEdweOKRtIn+jaWBnFvK8H03eixxW98mqXUlwDYwCktiqJzF6WZDPcx5rkNB5FoYlSc1Y8Q/pXZnEGfXdadwV0Q3A6FLzIsIPKxkG4kQpY7guvaCwWeKBDY/4qxkWhh8cs9QD3EVqGmnp8Go/zAeeXPnAyF3T0FAixmkAp/HiJdsBAeURE4ds+3l/I0lbwVPuC69bT6RsX/CLXMch8h4rvPKStEvewEtcQ9wAK+gFDpMDWZDrG+TXuziNdpldTw5O9rpYPkoI/aj/KgHQISmUdXdFX4dvG7M/5TfXtSEVDnRRYlsXihb646t0U5IOp82ScJKHVqxK/HHHH73geYSMSWXiur9X6eAJ3yvm+XD0t4CrnLx5owDeCVbEtoAsbWGUQQOu+3r6pxf4M4EuL2kPnNBd3oI4+qWYmgkckwlidJV0vpGnxWuG1J2a1yH8oMPE7CS3xRxQxPz0t5yU7vK3GWMt5pRyqQPHJCB/8yg2AwCUsucGE8bnSRv3rpHw5xlwjtSb/w== mariadanieldeepak@gmail.com