Month: October 2017

Select Text on Click of a Div with CSS

[php]
.selectable{
-webkit-touch-callout: all; /* iOS Safari */
-webkit-user-select: all; /* Safari */
-khtml-user-select: all; /* Konqueror HTML */
-moz-user-select: all; /* Firefox */
-ms-user-select: all; /* Internet Explorer/Edge */
user-select: all; /* Chrome and Opera */

}
[/php]

How to Set a default Title for the custom post?

[php]
function wpl_lc_add_custom_title( $data, $postarr ) {
if($data[‘post_type’] == ‘wpl_lcp_shortcodes’) {
if(empty($data[‘post_title’])) {
$data[‘post_title’] = ‘Untitled Carousel’;
}
}
return $data;
}
add_filter(‘wp_insert_post_data’, ‘wpl_lc_add_custom_title’, 10, 2 );
[/php]

Now use the function
[php]
the_title();
[/php]

Gray Scale with CSS with Cross Bowser Support

img {
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */
filter: grayscale(1); /* Microsoft Edge and Firefox 35+ */
}

/* Disable grayscale on hover */
img:hover {
-webkit-filter: grayscale(0);
filter: none;
}