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 custom_excerpt($limit, $post_id=NULL) { | |
if($post_id == NULL) { $the_excerpt = get_the_excerpt(); } | |
else { $the_excerpt = get_the_excerpt($post_id); } | |
$excerpt = explode(' ', $the_excerpt, $limit); | |
if (count($excerpt)>=$limit) { | |
array_pop($excerpt); | |
$excerpt = implode(" ",$excerpt).'...'; | |
} else { |
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
Sub MergeLines() | |
' | |
' MergeLines Macro | |
' | |
' | |
Selection.EndKey Unit:=wdLine | |
Selection.TypeText Text:=" " | |
Selection.Delete Unit:=wdCharacter, Count:=1 | |
End Sub |
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 | |
/* | |
Plugin Name: Autofill users info at checkout | |
*/ | |
function autofill_users_info_at_checkout_update_mata( $user_id ) { | |
add_user_meta($user_id, 'billing_phone', '0123456789'); |
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_filter('admin_init', 'msf_general_settings_register_fields'); | |
function msf_general_settings_register_fields() | |
{ | |
register_setting('general', 'homepage_image', 'esc_attr'); | |
add_settings_field('homepage_image', '<label for="homepage_image">'.__('Homepage Header Image' , 'homepage_image' ).'</label>' , 'msf_general_settings_fields_html', 'general'); | |
} | |
function msf_general_settings_fields_html() | |
{ |
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
jQuery(function() { | |
jQuery('a[href*="#"]:not([href="#"])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = jQuery(this.hash); | |
target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
jQuery('html, body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; |
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
.home .the-smart-way { | |
color: #fff; | |
background: #f7931e; | |
font-weight: bold; | |
height: 100px; | |
margin: 40px 0; | |
padding: 15px; | |
position: relative; | |
text-align: center; | |
} |
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
jQuery(document).ready(function($) { | |
let selector = $( '.selector' ) | |
// Get an array of all element heights | |
var elementHeights = selector.map( function() { | |
return $( this ).height(); | |
}).get() | |
// Math.max takes a variable number of arguments |
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 centerVertical(child, parent, property) { | |
var parentHeight = parent.height(), | |
childHeight = child.height(); | |
// Position the child with an inline style | |
child.css(property, (parentHeight - childHeight) / 2); | |
} centerVertical($('.js-vertical-align-child'), $('.js-vertical-align-parent'), 'margin-top'); |
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 tf_cleanup() { | |
// EditURI link | |
remove_action( 'wp_head', 'rsd_link' ); | |
// windows live writer | |
remove_action( 'wp_head', 'wlwmanifest_link' ); | |
// previous link | |
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); | |
// start link |
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
<div class="image"> | |
<!--<img src="images/map.png" alt="" />--> | |
<style> | |
#map { | |
height: 100%; | |
width: 100%; | |
} | |
@media (max-width: 767px) { | |
#map, |
OlderNewer