Skip to content

Instantly share code, notes, and snippets.

View fernandiez's full-sized avatar

Fernan fernandiez

View GitHub Profile
@fernandiez
fernandiez / style.css
Created February 24, 2017 12:03
Genesis Logo Before Site Title
.site-title a::before {
background-image: url(logo.png);
background-size: 46px 26px;
background-repeat: no-repeat;
display: inline-block;
width: 46px;
height: 26px;
content: "";
margin-right: 18px;
margin-bottom: -2px;
@fernandiez
fernandiez / functions.php
Created March 10, 2017 15:11
Add Page Excerpt
// Add Page Excerpts
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
@fernandiez
fernandiez / style.css
Created March 15, 2017 16:25
CSS3 Grayscale filter Property
// filter:
// none | blur(px) | brightness(%) | contrast(%) | drop-shadow(h-shadow v-shadow blur spread color) |
// grayscale(%) | hue-rotate(deg) | invert(%) | opacity(%) | saturate(%) | sepia(%) | url();
// initial inerit
.class .class img {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
@fernandiez
fernandiez / .htaccess
Created March 17, 2017 11:30
Redirect domain to https, subdomain to https and non-www to www
# Redirect domain to https, subdomain to https and non-www to www
# http://stackoverflow.com/questions/37614937/htaccess-redirect-domain-to-https-subdomain-to-https-and-non-www-to-www
RewriteEngine on
# redirect no-www to www only main domain, not with subdomain
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# redirect http to https all domain
@fernandiez
fernandiez / .htaccess
Created March 21, 2017 13:18
Redirect from old domain to new domain
# Redirect from old domain to new domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domainold.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domainold.com$
RewriteRule (.*)$ http://www.domainnew.com/$1 [R=301,L]
@fernandiez
fernandiez / .htaccess
Created April 6, 2017 06:19
Block Bing crawl bots .htaccess
# Block crawl bots .htaccess
# BEGIN Seguridad bots
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Bingbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^bingbot
RewriteRule ^.* - [F,L]
# END Seguridad bots
@fernandiez
fernandiez / robots.txt
Created April 6, 2017 10:32
Block Bing crawl bots robots.txt
User-agent: Bingbot
Disallow: /
@fernandiez
fernandiez / function.php
Last active April 18, 2017 16:21
Customize WordPress login logo image
// Customize WordPress login logo image
function my_login_logo() { ?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url('<?php echo get_stylesheet_directory_uri();?>/screenshot.png') !important;
width: 320px !important;
height: 240px !important;
background-size: 320px 240px !important;
}
</style>
@fernandiez
fernandiez / functions.php
Created April 20, 2017 18:59
Change Genesis Footer Credit Copyright line
// Change Genesis Footer Credit Copyright line
add_filter( 'genesis_footer_creds_text', 'wpb_footer_copyright_text' );
/**
* Change Genesis Footer Credit Copyright line
* @link http://wpbeaches.com/changing-genesis-theme-copyright-line-footer-wordpress/
*/
function wpb_footer_copyright_text () {
$copyright = '<div class="creditline"><p>Copyright &copy;' . date('Y') . ' &middot; <a href="http://www.domain.com/">Site Name</a> &middot; <a href="#">Link</a> &middot; <a href="#">Link</a> &middot; Site Description.</p></div>';
return $copyright;
@fernandiez
fernandiez / .htaccess
Created April 23, 2017 23:31
Domain 301 redirection from HTTP to HTTPS
# Domain 301 redirection from HTTP to HTTPS
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]