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 word_count($string, $limit) { | |
$words = explode(' ', $string); | |
return implode(' ', array_slice($words, 0, $limit)); | |
} | |
************* | |
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="flex-row row"> | |
<div class="col-xs-6 col-sm-4 col-lg-3"> | |
<div class="thumbnail"> | |
<div class="caption"> | |
<h3>Title</h3> | |
<p class="flex-text"> Content ...<p> | |
<p><a class="btn btn-primary" href="#">Link</a></p> | |
</div> | |
</div> | |
</div> |
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 reset_post_date_wpse_121565($data,$postarr) { | |
// var_dump($data,$postarr); die; // debug | |
$data['post_date'] = $data['post_modified']; | |
$data['post_date_gmt'] = $data['post_modified_gmt']; | |
return $data; | |
} | |
add_filter('wp_insert_post_data','reset_post_date_wpse_121565',99,2); |
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
<!--Start of Zopim Live Chat Script--> | |
<script type="text/javascript"> | |
if (Math.min(window.screen.availHeight,window.screen.availWidth) > 480) { | |
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s= | |
: : : : : : : : : : : : : | |
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script'); | |
} | |
</script> | |
<!--End of Zopim Live Chat Script--> |
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
Сложный способ без плагина: | |
Создаем в корне где лежит сайт, файл с именем .maintenance это файл создается wordpress когда идут какие либо обновления движка, после он удаляется. | |
<?php | |
function is_user_logged_in() { | |
$loggedin = false; | |
foreach ( (array) $_COOKIE as $cookie => $value ) { | |
if ( stristr($cookie, 'wordpress_logged_in_') ) | |
$loggedin = true; | |
} |
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
define('FS_METHOD','direct'); |
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 | |
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
function custom_override_checkout_fields( $fields ) { | |
unset($fields['billing']['billing_first_name']); | |
unset($fields['billing']['billing_last_name']); | |
unset($fields['billing']['billing_company']); | |
unset($fields['billing']['billing_address_1']); | |
unset($fields['billing']['billing_address_2']); |
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
Version01 | |
<div class="image-container"> | |
<img src="http://placehold.it/100x100" /> | |
</div> | |
.image-container { | |
width: 200px; | |
display: flex; | |
justify-content: 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
in functions.php: | |
//add a widget area in the header as described by TomHart | |
if ( function_exists ('register_sidebar') ) | |
register_sidebar( array( | |
'name' => __( 'Header Widgets Area', 'twentythirteen' ), | |
'id' => 'sidebar-header', | |
'description' => __( 'Header widgets area for my child theme.' , 'twentythirteen' ), | |
'before_widget' => '<aside id="%1$s" class="widget %2$s">', | |
'after_widget' => '</aside>', |