Skip to content

Instantly share code, notes, and snippets.

@anestan
anestan / function days jquery ui datetimepicker
Created July 13, 2014 15:42
function days jquery ui datetimepicker
function days() {
var a = $("#datepicker_start").datepicker('getDate').getTime(),
b = $("#datepicker_end").datepicker('getDate').getTime(),
c = 24*60*60*1000,
diffDays = Math.round(Math.abs((a - b)/(c)));
console.log(diffDays); //show difference
}
// auto make id with name field
$('form,input,textarea,select').each(function(index) {
$(this).attr("id",$(this).attr("name"));
});
@anestan
anestan / Preferences.sublime-settings
Last active September 29, 2016 08:58
Sublime Text Preferences
{
"bold_folder_labels": true,
"file_exclude_patterns":
[
".DS_Store"
],
"folder_exclude_patterns":
[
"bin",
".bundle",
@anestan
anestan / gist:913dbc0bb58cc89ca2c0
Created April 27, 2015 22:55
fix width for icelock portfolio
@media screen and (min-width: 62em) {
.grid-1-3 {
width: 250px;
min-width: 250px;
}
}
@anestan
anestan / gist:7fffb6c6b9aee94953ee
Last active August 29, 2015 14:20
icelock - Auto slideshow testimonial function
$('#testimonial-slider').flexslider({
animation: "fade",
slideshow: true,
slideshowSpeed: 3000,
animationDuration: 200,
directionNav: false,
});
@anestan
anestan / gist:732214fc3592f4bf63bf
Created April 28, 2015 23:19
icelock - testimonial text widget flexslider
<h3>“You know you're in love when you can't fall asleep because reality is finally better than your dreams.” </h3>
<h4>Dr. Seuss</h4>
@anestan
anestan / gist:75d29814901f01f274e9
Last active August 29, 2015 14:22
icelock - add attachment title for flexslider
echo "<div class='gallery-wrap'><div class='flexslider'><ul class='slides'>";
foreach ($id as $image_id) {
if ( is_single() ) {
echo "<li> <a href='". wp_get_attachment_url($image_id) ."'>";
} else {
echo "<li> <a href='". get_permalink($post->ID) ."'>";
}
echo wp_get_attachment_image($image_id, 'featured-image', false, false);
echo "</a>";
@anestan
anestan / functions.php
Last active March 10, 2018 00:02
icelock - Use Polylang Plugins for customizer homepage
// check Polylang exist
if ( function_exists('pll_register_string') ) {
$icelock_title_portfolio_section = get_theme_mod('icelock_title_portfolio_section', '');
pll_register_string('Portfolio Section Title', $icelock_title_portfolio_section);
$icelock_title_team_section = get_theme_mod('icelock_title_team_section', '');
pll_register_string('Team Section Title', $icelock_title_team_section);
$icelock_title_recent_post_section = get_theme_mod('icelock_title_recent_post_section', '');
pll_register_string('Recent Post Section Title', $icelock_title_recent_post_section);
$icelock_title_testimonials_section = get_theme_mod('icelock_title_testimonials_section', '');
pll_register_string('Testimonial Section Title', $icelock_title_testimonials_section);
@anestan
anestan / homepage.php
Created October 10, 2015 06:04
icelock - modify homepage with polylang
<!-- PORTFOLIO SECTION -->
<h2>
<?php
if ( function_exists('pll_register_string') ) {
echo pll__(get_theme_mod('icelock_title_portfolio_section'));
} else {
echo get_theme_mod('icelock_title_portfolio_section');
}
?>
@anestan
anestan / footer.php
Created October 10, 2015 06:06
icelock - modify footer with polylang