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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTP:Accept-Language} ^en [NC] | |
| RewriteRule ^/?$ http://www.zendergroup.com/en/ [R,NC,L] | |
| RewriteCond %{HTTP:Accept-Language} ^de [NC] | |
| RewriteRule ^/?$ http://www.zendergroup.com/de/ [R,NC,L] | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f |
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 interval = null; | |
| jQuery(function(){ | |
| interval = setInterval(callFunc, 5000); | |
| }); | |
| function callFunc(){ | |
| jQuery('.slick-next').trigger('click'); | |
| } |
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
| $('.one-slide').each(function() { // the containers for all your galleries | |
| $(this).magnificPopup({ | |
| delegate: 'a', // the selector for gallery item | |
| type: 'image', | |
| gallery: { | |
| enabled:true | |
| } | |
| }); | |
| }); |
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
| //PHP | |
| function getDistance($latitude1, $longitude1, $latitude2, $longitude2) { | |
| $earth_radius = 6371; | |
| $dLat = deg2rad($latitude2 - $latitude1); | |
| $dLon = deg2rad($longitude2 - $longitude1); | |
| $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * sin($dLon/2) * sin($dLon/2); | |
| $c = 2 * asin(sqrt($a)); | |
| $d = $earth_radius * $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
| //wordpress function.php | |
| function _remove_script_version( $src ){ | |
| $parts = explode( '?', $src ); | |
| return $parts[0]; | |
| } | |
| add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
| add_filter( 'style_loader_src', '_remove_script_version', 15, 1 ); |
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
| //se si preme enter | |
| $(document).on("keyup", "input", function(event) { | |
| // If enter is pressed then hide keyboard. | |
| if(event.keyCode == 13) { | |
| $("input").blur(); | |
| } | |
| }); | |
| //nasconde | |
| $("input").blur(); |
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
| //esempio | |
| $("#findstore").autocomplete({ | |
| minLength:3, | |
| source: function(request, response) { | |
| var matches = $.map( availableTags, function(tag) { | |
| if ( tag.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) { | |
| return tag; | |
| } | |
| }); |
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
| cd /Applications/XAMPP/xamppfiles/ | |
| This will get you to the XAMPP file directory. Now we’re going to modify your htdocs directory: | |
| sudo chown -R daemon htdocs | |
| Enter your root password when prompted, then finish it out with a chmod call: | |
| sudo chmod -R g+w htdocs | |
| And you’re done! |
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
| function excerpt_count_js(){ | |
| if ('page' != get_post_type()) { | |
| echo '<script>jQuery(document).ready(function(){ | |
| jQuery("#postexcerpt .handlediv").after("<div style=\"position:absolute;top:12px;right:34px;color:#666;\"><small>Excerpt length: </small><span id=\"excerpt_counter\"></span><span style=\"font-weight:bold; padding-left:7px;\">/ 500</span><small><span style=\"font-weight:bold; padding-left:7px;\">character(s).</span></small></div>"); | |
| jQuery("span#excerpt_counter").text(jQuery("#excerpt").val().length); | |
| jQuery("#excerpt").keyup( function() { | |
| if(jQuery(this).val().length > 500){ | |
| jQuery(this).val(jQuery(this).val().substr(0, 500)); |
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
| <?php | |
| $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
| $the_query = new WP_Query( array ( | |
| 'post_type' => 'offer', | |
| 'post_status' => 'publish', | |
| 'orderby' => 'date', | |
| 'order' => 'DESC', | |
| 'paged' => $paged | |
| ) ); |