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 getYouTubeID($url){ | |
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $url, $matches); | |
return $matches[1]; | |
} |
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 | |
$time_diff = human_time_diff( get_the_date('U'), current_time('timestamp') ); | |
if( preg_match('~day|month|year~iu', $time_diff ) ) | |
$date = get_the_date('M d'); | |
else | |
$date = $time_diff.' '.__('ago', 'project-locatization-name'); | |
?> | |
<p><?php echo $date ?></p> |
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 | |
function custom_column_header( $columns ){ | |
$columns['image'] = 'Image'; | |
unset($columns['description']); | |
return $columns; | |
} | |
add_filter( "manage_edit-arts_cat_columns", 'custom_column_header', 10); | |
function custom_column_content( $value, $column_name, $term_id ){ |
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
$('.slick-slider').not('.slick-initialized').slick({ | |
infinite: false, | |
slidesToShow: 1, | |
slidesToScroll: 1, | |
dots: true, | |
arrows: false, | |
touchThreshold: 9 | |
}); |
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_action( 'pre_get_posts' ,'dnshulga_exclude_pages' ); | |
function dnshulga_exclude_pages( $query ) { | |
if( !is_admin() ) | |
return $query; | |
global $pagenow; | |
if( 'edit.php' == $pagenow && ( get_query_var('post_type') && 'page' == get_query_var('post_type') ) ) | |
$query->set( 'post__not_in', array(213, 221) ); //ids of pages to hide | |
return $query; |
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 remove_default_woo_image_sizes( $sizes ) { | |
unset( $sizes[ 'shop_thumbnail' ]); | |
unset( $sizes[ 'shop_catalog' ]); | |
unset( $sizes[ 'shop_single' ]); | |
unset( $sizes[ 'woocommerce_thumbnail' ]); | |
unset( $sizes[ 'woocommerce_single' ]); | |
unset( $sizes[ 'woocommerce_gallery_thumbnail' ]); | |
return $sizes; | |
} |
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 | |
/*Hide ACF Tottally*/ | |
add_filter('acf/settings/show_admin', '__return_false'); | |
function pands_admin_colors() { | |
echo '<style type="text/css"> | |
h2.hndle.ui-sortable-handle a.acf-hndle-cog { display: none; visibility: hidden } | |
</style>'; | |
} | |
add_action('acf/input/admin_head', 'pands_admin_colors'); | |
function disallowed_acf_page() { |