View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
use GeoIp2\Database\Reader; | |
/** | |
* Returns the visitors IP address. | |
* @return string | |
*/ |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// functions.php code... | |
$geoip2_country_code = get_geoip2_country_code( get_visitor_IP() ); | |
if ( $geoip2_country_code == 'HR' ) { | |
wp_redirect( $lander_URL ); exit; | |
} |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
use GeoIp2\Database\Reader; | |
// Instantiate the "GeoIp2" Reader object | |
$reader = new Reader( get_template_directory() . '/GeoLite2-Country.mmdb' ); | |
// Get country details for 78.134.247.178 IP address | |
$result = $reader->country( '78.134.247.178' )->country; |
View header.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> | |
<meta charset="<?php bloginfo( 'charset' ); ?>"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="profile" href="http://gmpg.org/xfn/11"> | |
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
function wpmm_init() { | |
$location = 'mega_menu'; | |
$css_class = 'has-mega-menu'; | |
$locations = get_nav_menu_locations(); | |
if ( isset( $locations[ $location ] ) ) { | |
$menu = get_term( $locations[ $location ], 'nav_menu' ); |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
function wpmm_setup() { | |
register_nav_menus( array( | |
'mega_menu' => 'Mega Menu' | |
) ); | |
} | |
add_action( 'after_setup_theme', 'wpmm_setup' ); |
View scripts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($){ | |
$('img.inflated') | |
.on('webkitmouseforcewillbegin', function(event){ | |
event.preventDefault(); | |
}) | |
.on('webkitmouseforcechanged', function(event){ | |
$(event.target).css({ | |
width: 200 + event.originalEvent.webkitForce * 30 | |
}); | |
}) |
View style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.balloon { width: 262px; height: 300px; position: absolute; top: 50%; left: 50%; margin: -150px 0 0 -131px; } | |
.balloon img { width: 200px; margin-left: auto; margin-right: auto; } | |
.balloon img.inflated, .balloon.pop img.popped { display: block; } | |
.balloon.pop img.inflated, .balloon img.popped { display: none; } |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Force Touch Demo</title> | |
<link rel='stylesheet' href='style.css' type='text/css' /> | |
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> | |
</head> | |
<body> | |
<div class="container"> |
View package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"gulp": "3.9.x", | |
"gulp-less": "3.x.x" | |
}, | |
"scripts": { | |
"build:less": "gulp less" | |
}, | |
"bin": { | |
"gulp": "node ./node_modules/gulp/bin/gulp.js" |
NewerOlder