Reference for language code : Language Code
<?php
$currLang = get_bloginfo('language');
if($currLang == "id-ID"){ // Replace condition with your language code.
echo 'Bahasa Indonesia';
} else {
echo 'up to you'
}
?>
<?php
$currLang = get_bloginfo('language');
if($currLang == "id-ID"){ // Replace condition with your language code.
echo 'Bahasa Indonesia';
} else {
echo 'up to you'
}
?>
<!-------------------------------------------------------- | |
SNIPPETS INDEX | |
-- 01 - Enqueue Google Fonts | |
-- 02 - Make jQuery load from Google Library | |
-- 03 - Customize excerpt length and read more characters | |
-- 04 - Enable Pagination Links | |
-- 05 - Replace WP login logo with custom | |
-- 06 - Displays a custom Dashboard Widget | |
-- 07 - Allow different file formats in Media Library | |
-- 08 - Turn Off Your Self-referring Pingbacks |
When setting these options consider the following:
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
<?php | |
// Flush rewrite rules after switch theme | |
function my_rewrite_flush() { | |
flush_rewrite_rules(); | |
} | |
add_action( 'after_switch_theme', 'my_rewrite_flush' ); | |
// A little help so we can get the stylesheet from parent theme | |
// Remove line 10-19 if this is not a child theme | |
function my_enqueue_styles() { |
#!/bin/bash | |
set -e | |
cf_ips() { | |
echo "# https://www.cloudflare.com/ips" | |
for type in v4 v6; do | |
echo "# IP$type" | |
curl -sL "https://www.cloudflare.com/ips-$type/" | sed "s|^|allow |g" | sed "s|\$|;|g" |
/* Allows focus on sub menu items by tabbing menu | |
------------------------------------------------ */ | |
.oxy-nav-menu:not(.oxy-nav-menu-open) .menu-item .sub-menu { | |
right: 5000px; | |
visibility: visible; | |
} | |
.oxy-nav-menu:not(.oxy-nav-menu-open).menu-item .sub-menu .sub-menu { | |
right: auto; |
<?php | |
/** | |
* Inspired by https://raw.githubusercontent.com/zendframework/zend-http/master/src/PhpEnvironment/RemoteAddress.php | |
*/ | |
//PHP 5.6 | |
function get_ip( $trusted_proxies = [] ) { | |
if ( ! empty( $trusted_proxies ) && isset( $_SERVER['REMOTE_ADDR'] ) && ! in_array( $_SERVER['REMOTE_ADDR'], $trusted_proxies ) ) { | |
if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) { | |
$ip = $_SERVER['HTTP_CF_CONNECTING_IP']; | |
} elseif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) { |
<?php | |
/** | |
* Add LocalBusiness to schema Organization | |
* | |
* @api array $data The graph piece to filter. | |
* | |
* @return array | |
*/ | |
function custom_wpseo_schema_organization($data){ | |