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
<!-- OVERLAY POPUP BIANCO --> | |
<div class="popup-overlay-white"> | |
<div class="content1"> | |
<h5>Recuperi insoluti in bolletta, tutto quello che c'è da sapere.</h5> | |
</div> | |
<div class="content2"> | |
<p> | |
Su social e articoli continua a diffondersi la falsa notizia di rincari di 35€ /40€ in bolletta. | |
Facciamo chiarezza sulla questione approfondendo la delibera dell'ARERA n. 50/2018. | |
<br> |
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
// Add role class to body | |
function add_role_to_body($classes) { | |
global $current_user; | |
$user_role = array_shift($current_user->roles); | |
$classes[] .= 'role-'. $user_role; | |
return $classes; | |
} | |
add_filter('body_class','add_role_to_body'); |
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
/** | |
* enqueue scripts and styles | |
* | |
*/ | |
function nr_load_scripts() { | |
wp_register_script('googlemaps', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyCxucarwzsej2hTS4d89VnYICal7OB6-cw',null,null,true); | |
wp_enqueue_script('googlemaps'); | |
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
.flex-direction-nav a:before { | |
content: " "; | |
display: block; | |
background: url('img/prev.png') no-repeat center center; | |
background-size: contain; | |
width: 40px; | |
height: 40px; | |
} | |
.flex-direction-nav a.flex-next:before { | |
content: " "; |
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 | |
$province = array( | |
'AG' => 'Agrigento', | |
'AL' => 'Alessandria', | |
'AN' => 'Ancona', | |
'AO' => 'Aosta', | |
'AR' => 'Arezzo', | |
'AP' => 'Ascoli Piceno', | |
'AT' => 'Asti', | |
'AV' => 'Avellino', |
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 | |
$args = array( | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => '0', | |
'hierarchical' => 1, | |
); | |
$categories = get_categories($args); |
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
// chiamata ajax per la pagina category load more posts | |
function load_old_post() | |
{ | |
$offset = $_GET['offset']; | |
$category = $_GET['category']; | |
$args = array( 'posts_per_page' => 2 , 'cat' => $category, 'offset' => $offset ); | |
$theme_post_query = new WP_Query( $args ); | |
while( $theme_post_query->have_posts() ) : $theme_post_query->the_post();?> | |
<?php $category = get_the_category(); $category = $category[0]; ?> | |
<?php $parent_cat = get_cat_name( $category->parent ); ?> |
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
$salt = uniqid(mt_rand(), true); | |
function getSaltedHash($password, $salt) { | |
$hash = $password . $salt; | |
for ($i = 0; $i < 50; $i++) { | |
$hash = hash('sha512', $password . $hash . $salt); | |
} | |
return $hash; | |
} |
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 _save_attachment_url($post, $attachment) { | |
if ( isset($attachment['url']) ) | |
update_post_meta( $post['ID'], '_wp_attachment_url', esc_url_raw($attachment['url']) ); | |
return $post; | |
} | |
add_filter('attachment_fields_to_save', '_save_attachment_url', 10, 2); | |
function _replace_attachment_url($form_fields, $post) { | |
if ( isset($form_fields['url']['html']) ) { | |
$url = get_post_meta( $post->ID, '_wp_attachment_url', true ); | |
if ( ! empty($url) ) |
NewerOlder