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
function my_template( $template ) { | |
$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; | |
// check if the page url contains ?id= | |
if( strpos($url,'?id=') !== false ){ | |
if ( $new_template = locate_template( array( 'page-company-profile.php' ) ) ) | |
return $new_template ; | |
} | |
return $template; | |
} |
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
function loadIP() { | |
const xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'https://freegeoip.net/json/', true); | |
xhr.onload = function() { | |
const data = JSON.parse(this.response); | |
const country = data.country_code; | |
console.log(country); | |
const europe = ['GB', 'AL', 'AD', 'AT', 'BY', 'BE', 'BA', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FO', 'FI', 'FR', 'DE', 'GI', 'GR', 'HU', 'IS', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU', 'MK', 'MT', 'MD', 'MC', 'NL', 'NO', 'PL', 'PT', 'RO', 'RU', 'SM', 'RS', 'SK', 'SI', 'ES', 'SE', 'CH', 'UA', 'VA', 'RS', 'IM', 'RS', 'ME', 'DE']; | |
const inEU = europe.indexOf(country) !== -1; |
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
/* Create Reducer, which is a function | |
that produces some amount of state | |
*/ | |
const reducer = (state = [], action) => { | |
if (action.type === 'split_string') { | |
return action.payload.split(''); | |
} else if (action.type === 'add_character') { | |
// Make a new array | |
// Take all elements in current State array | |
// Add action.payload to new State |
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
const disneyMagicKingdom = new Themeparks.Parks.WaltDisneyWorldMagicKingdom(); | |
const epcot = new Themeparks.Parks.WaltDisneyWorldEpcot(); | |
const disneyHollywoodStudios = new Themeparks.Parks.WaltDisneyWorldHollywoodStudios(); | |
const disneyAnimalKingdom = new Themeparks.Parks.WaltDisneyWorldAnimalKingdom(); | |
const universalStudiosFlorida = new Themeparks.Parks.UniversalStudiosFlorida(); | |
const universalIslandsOfAdventure = new Themeparks.Parks.UniversalIslandsOfAdventure(); | |
const universalVolcanoBay = new Themeparks.Parks.UniversalVolcanoBay(); | |
const seaworldOrlando = new Themeparks.Parks.SeaworldOrlando(); |
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
function getAllCategories() { | |
const allCategories = [417, 418, 419, 420, 421, 422] | |
for (let categories of allCategories) { | |
let ourRequest = new XMLHttpRequest() | |
ourRequest.open('GET', 'https://www.orlandoattractions.com/wp-json/wp/v2/posts?categories=' + categories) | |
ourRequest.onload = () => { | |
if (ourRequest.status >= 200 && ourRequest.status < 400) { |