Skip to content

Instantly share code, notes, and snippets.

View iqbalmauludy's full-sized avatar

Iqbal Mauludy iqbalmauludy

View GitHub Profile
<script>
function openNav() {
document.getElementById("myNav").style.height = "100%";
}
function closeNav() {
document.getElementById("myNav").style.height = "0%";
}
</script>
@iqbalmauludy
iqbalmauludy / header-location.php
Created December 19, 2017 12:15
Gist sampel untuk artikel blog
<?php
header('Location: https://google.com'); // Manual atau dokumentasi dari http://php.net/manual/en/function.header.php
?>
@iqbalmauludy
iqbalmauludy / google-ads.php
Created December 20, 2017 12:55
Contoh sample kode dari Google Adsense
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-76782292xxxxxxxx",
enable_page_level_ads: true
});
</script>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
define('FORCE_SSL_ADMIN', true);
function currentYear( $atts ){
return date('Y');
}
add_shortcode( 'year', 'currentYear' );
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
// Disable Comments URL field
function imwp_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','imwp_disable_comment_url');