Skip to content

Instantly share code, notes, and snippets.

View tevashov's full-sized avatar

Teff tevashov

View GitHub Profile
@tevashov
tevashov / Asset.php
Last active October 27, 2022 21:56
Change WordPress default FROM email address #WP
 function new_mail_from($old) {
return 'admin@yourdomain.com';
}
function new_mail_from_name($old) {
return 'Your Blog Name';
}
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
@tevashov
tevashov / Asset.css
Last active October 27, 2022 21:28
Clearfix
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
@tevashov
tevashov / Asset.js
Last active October 27, 2022 21:39
Hide all children div except a specific one #jQuery
$('#target div:not(#exclude)').hide();
//or
$('#target').children().filter(':not(#exclude)').hide();
@tevashov
tevashov / Asset.php
Last active October 27, 2022 21:51
Customize Login Page Logo link & ALT text #WP
// CUSTOM ADMIN LOGIN LOGO LINK
function change_wp_login_url() {
return bloginfo('url'); // OR ECHO YOUR OWN URL
}
add_filter('login_headerurl', 'change_wp_login_url');
// CUSTOM ADMIN LOGIN LOGO & ALT TEXT
function change_wp_login_title() {
return get_option('blogname'); // OR ECHO YOUR OWN ALT TEXT
}
@tevashov
tevashov / Asset.js
Last active October 27, 2022 21:31
Validate Credit Card #JS
function isCreditCard( CC ){
if (CC.length > 19)
return (false);
sum = 0; mul = 1; l = CC.length;
for (i = 0; i < l; i++){
digit = CC.substring(l-i-1,l-i);
tproduct = parseInt(digit ,10)*mul;
if (tproduct >= 10)
sum += (tproduct % 10) + 1;
@tevashov
tevashov / Asset.css
Created March 15, 2013 19:34
Table row stripes
table tr:nth-child(even) {
background: rgba(0,0,0,0.1);
}
@tevashov
tevashov / Asset.css
Created March 15, 2013 19:34
Box model
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
@tevashov
tevashov / Asset.php
Last active October 27, 2022 21:51
Change Contents of Dashboard Help Tab #WP
// hook loading of new page and edit page screens  
function add_custom_help_page() {  
   //the contextual help filter  
   add_filter('contextual_help','custom_page_help');  
}
function custom_page_help($help) {  
   //keep the existing help copy  
   echo $help;  
@tevashov
tevashov / Asset.js
Last active October 27, 2022 21:42
Refresh the src of an image with jQuery? #jQuery
$(imageobj).attr('src', $(imageobj)
.attr('src') + '?' + Math.random() );
@tevashov
tevashov / Asset.css
Last active October 27, 2022 21:28
Image replacement (text hiding)
.ir {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}