This file contains hidden or 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
// I needed flatuicolors.com as Sass variables... | |
// In your console, run: | |
$('.color').get().map(function(el) { return "$" + el.classList[1] + ": " + el.getAttribute('data-clipboard-text') + ';' }).join('\r\n'); | |
// Output: | |
// $turquoise: #1abc9c; | |
// $emerland: #2ecc71; | |
// $peter-river: #3498db; | |
// $amethyst: #9b59b6; | |
// $wet-asphalt: #34495e; |
This file contains hidden or 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 filter_ptags_on_images($content){ | |
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); | |
} | |
add_filter('the_content', 'filter_ptags_on_images'); |
This file contains hidden or 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
// ----------- | |
// Debugger that shows view port size. Helps when making responsive designs. | |
// ----------- | |
function showViewPortSize(display) { | |
if(display) { | |
var height = jQuery(window).height(); | |
var width = jQuery(window).width(); | |
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>'); | |
jQuery(window).resize(function() { |
This file contains hidden or 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_filter( 'login_errors', 'rs_custom_login_error' ); | |
/* | |
* @desc Filter Wordpress admin error message | |
*/ | |
function rs_custom_login_error(){ | |
return $error = "Oops!, sorry you have inputted wrong credentials."; | |
} |
This file contains hidden or 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 | |
// ---------------------------------------------------------------------------------------- | |
// Redirect all non-logged-in users to the login page (private site). Add to functions.php. | |
// ---------------------------------------------------------------------------------------- | |
function admin_redirect() { | |
if ( !is_user_logged_in()) { | |
wp_redirect( home_url('/wp-login.php/') ); | |
exit; |
This file contains hidden or 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
body.login { background-color: black;} | |
body.login div#login {} | |
body.login div#login h1 {margin-bottom: 20px;} | |
/* ------ UPDATE LOGO IMAGE - NOTE: must declare background size of image ------ */ | |
body.login div#login h1 a {background-position: top center; background-repeat: no-repeat;background-image: url(img/logo.png);height: 109px; background-size: 209px 109px; height: 80px;} | |
body.login div#login form#loginform { background-color: black; border: none; box-shadow: none;} | |
body.login div#login form#loginform p {} | |
body.login div#login form#loginform p label { color: white;} | |
body.login div#login form#loginform input {} | |
body.login div#login form#loginform input#user_login {} |
This file contains hidden or 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 | |
// The Query | |
$args = array( | |
'post_type' => 'my_custom_post_type', | |
'order' => 'DESC', // DESC or ASC | |
'posts_per_page' => -1, | |
// Call custom taxonomy |
This file contains hidden or 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
/* | |
Theme Name: Bear Necessities | |
Theme URI: http://teolopez.com/themes | |
Description: Bear Necessities Starter Theme | |
Author: Teo Lopez | |
Author URI: http://teolopez.com/ | |
Version: 1.0 | |
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional) | |
License: GNU General Public License v2 or later |
This file contains hidden or 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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html <?php language_attributes(); ?> class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta charset="<?php bloginfo( 'charset' ); ?>" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title><?php wp_title(); ?></title> |
This file contains hidden or 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 Post On New User Registration and Assign to User Registration | |
// ----------------------------------------------------------------- | |
add_action( 'user_register', 'gamma_new_user_post' ); | |
/** | |
* Add a new post when user registers. | |
*/ | |
function gamma_new_user_post( $user_id ) { |