This file contains hidden or 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
// Custom excerpt accepting html tags | |
function wpse_allowedtags() { | |
// Allow the following HTML tags: | |
return '<br>,<p>'; | |
} | |
if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) : | |
function wpse_custom_wp_trim_excerpt($wpse_excerpt) { | |
$raw_excerpt = $wpse_excerpt; | |
if ( '' == $wpse_excerpt ) { |
This file contains hidden or 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
<div class="placeholder"> | |
<div class="loader"> | |
<div class="loader1"></div> | |
<div class="loader2"></div> | |
<div class="loader3"></div> | |
</div> | |
</div> |
This file contains hidden or 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
$.getJSON('http://api.wunderground.com/api/API_KEY/conditions/q/CITY_NAME.json', function(Weather) { | |
var weatherInfo = Weather.current_observation; | |
console.log(weatherInfo.temp_c); | |
document.getElementById('weatherTempC').innerHTML = weatherInfo.temp_c; | |
}); |
This file contains hidden or 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
$.getJSON('http://api.wunderground.com/api/API_KEY/conditions/q/CITY_NAME.json', function(Weather) { | |
var weatherInfo = Weather.current_observation; | |
var weatherIcon = '<span id="weatherIcon" class="meteoIcon" data-icon="1">'; | |
if(weatherInfo.weather === 'Partly Cloudy') { | |
weatherIcon = '<span id="weatherIcon" class="meteoIcon" data-icon="3">'; | |
} | |
else if (weatherInfo.weather === 'Mostly Cloudy') { | |
weatherIcon = '<span id="weatherIcon" class="meteoIcon" data-icon="5">'; | |
} | |
else if (weatherInfo.weather === 'Rain') { |
This file contains hidden or 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
var dateString = Date.parse("2016-08-01T12:00:00+0000"); | |
var fbSince = dateString / 1000; | |
document.write(fbSince); |
This file contains hidden or 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
refreshWeather(); | |
setInterval(refreshWeather, 600000); // Recall every 10 min |
This file contains hidden or 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
<Select id="packageOption"> | |
<option value="">None</option> | |
<option value="package1">Package1</option> | |
<option value="package2">Package2</option> | |
<option value="package3">Package3</option> | |
</Select> | |
<div id="package1" class="packages" > Package1 </div> | |
<div id="package2" class="packages" > Package2 </div> | |
<div id="package3" class="packages" > Package3 </div> |
This file contains hidden or 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
// Allow the editor to edit theme options | |
function add_theme_caps() { | |
// gets the editor role | |
$role = get_role( 'editor' ); | |
// This only works, because it accesses the class instance. | |
// would allow the editor to edit options posts for current theme only | |
$role->add_cap( 'manage_options' ); | |
} | |
add_action( 'admin_init', 'add_theme_caps'); |
This file contains hidden or 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
$sql = "BEGIN TRANSACTION;"; | |
$sql .= "INSERT INTO table1 (name1) VALUES (value1);"; | |
$sql .= "INSERT INTO table2 (name2) VALUES (value2);"; | |
$sql .= "COMMIT;"; |