Skip to content

Instantly share code, notes, and snippets.

@LucasMMBB
LucasMMBB / change lang tag
Last active July 11, 2016 20:08
Change lang tag on specific pages in WordPress
function change_html_lang_tag(){
if(is_page('en-espanol')){
return "lang = \"es\"";
}elseif (is_page('russko-govoryashchiy-yuridicheskiye-uslugi')) {
return "lang = \"ru\"";
}else{
return "lang = \"en-US\"";
}
<script type="text/javascript">
/**
* Put his file in head
*/
function my_redirect() {
var name = document.getElementById('name-sidebar-maoxu').value;
var email = document.getElementById('email-sidebar-maoxu').value;
var movedate = document.getElementById('date-sidebar-maoxu').value;
//set up cookie
@LucasMMBB
LucasMMBB / parse_url_data
Last active June 28, 2016 21:27
Parse data from and place data into form
<!--
Author: Maoxu Liu
Description: parse data from url and place them into form
Create date: June 28, 2016
Version:0.0.1
-->
<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
<!--
Modified by Maoxu on June 16, 2016
Description: added the function, which copy mini-form input data to other forms.
-->
<!-- function starts here -->
<script type="text/javascript">
function mini_form_fill_redirect() {
var movedate = document.getElementById('vfb-48').value;
var movefrom = document.getElementById('vfb-44').value;
var moveto = document.getElementById('vfb-45').value;