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'
}
?>
/** | |
* Image preloader | |
* | |
* @link http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript | |
*/ | |
var cache = []; | |
// Arguments are image paths relative to the current page. | |
function pilau_preload_images() { | |
var args_len, i, cache_image; | |
args_len = arguments.length; |
header("Content-type: text/xml; charset=utf-8"); | |
//create your XML document, using the namespaces | |
$urlset = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" /><!--?xml version="1.0" encoding="UTF-8"?-->'); | |
//iterate over your sites pages or whatever you like | |
foreach (getMyPagesOrWhatEver() as $item): | |
//add the page URL to the XML urlset |
/* | |
* Polylang Language API functions tester - WordPress | |
* Github: https://gist.github.com/icetee/fbbfef5534fead58611e | |
* | |
*/ | |
function ex_pll_the_languages($arg = '') { | |
if ( function_exists('pll_the_languages') ) { | |
return pll_the_languages($arg); | |
} |
# v2 7/29/2015 | |
# prevent listing files in folders | |
Options -Indexes | |
# some security rules | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# prevent php execution in uploads | |
RewriteRule /uploads/.*\.php - [F] |
<?php | |
/* | |
Plugin Name: A faster load_textdomain | |
Version: 0.0.1 | |
Description: While we're wating for https://core.trac.wordpress.org/ticket/32052. | |
Author: Per Soderlind | |
Author URI: https://soderlind.no | |
Plugin URI: https://gist.github.com/soderlind/610a9b24dbf95a678c3e | |
License: GPL |
<?php | |
add_filter( 'rewrite_rules_array', 'cache_frontend_ajax_rules' ); | |
/** | |
* Rewrite rules filter to add rules for front end ajax calls | |
* | |
* @param array $rewrite_rules | |
* | |
* @return array | |
*/ |
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove all JSON output by Yoast SEO | |
* Credit: Yoast development team | |
* Documentation: https://developer.yoast.com/schema-documentation/api/ | |
* Last Tested: Apr 16 2019 using Yoast SEO 11.0 on WordPress 5.1.1 | |
*/ | |
add_filter( 'wpseo_json_ld_output', '__return_false' ); |
<?php
$currLang = get_bloginfo('language');
if($currLang == "id-ID"){ // Replace condition with your language code.
echo 'Bahasa Indonesia';
} else {
echo 'up to you'
}
?>