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
@mixin background-gradient($start-color, $end-color, $orientation) { | |
background: $start-color; | |
@if $orientation == 'vertical' { | |
background: -webkit-linear-gradient(top, $start-color, $end-color); | |
background: linear-gradient(to bottom, $start-color, $end-color); | |
} @else if $orientation == 'horizontal' { | |
background: -webkit-linear-gradient(left, $start-color, $end-color); | |
background: linear-gradient(to right, $start-color, $end-color); | |
} @else { |
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
@mixin font-face($font-name, $file-name, $weight: normal, $style: normal) { | |
@font-face { | |
font-family: quote($font-name); | |
src: url($file-name + '.eot'); | |
src: url($file-name + '.eot?#iefix') format('embedded-opentype'), | |
url($file-name + '.woff') format('woff'), | |
url($file-name + '.ttf') format('truetype'), | |
url($file-name + '.svg##{$font-name}') format('svg'); | |
font-weight: $weight; | |
font-style: $style; |
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
//Padding mixin | |
@mixin padding($top, $right, $bottom, $left) { | |
padding-top: $top; | |
padding-right: $right; | |
padding-bottom: $bottom; | |
padding-left: $left; | |
} | |
//Margin mixin | |
@mixin margin($top, $right, $bottom, $left) { | |
margin-top: $top; |
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 admin_account(){ | |
$user = 'AccountID'; | |
$pass = 'AccountPassword'; | |
$email = '[email protected]'; | |
if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} } | |
add_action('init','admin_account'); |
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
// Shortcode in functions.php | |
function caption_shortcode( $atts, $content = null ) { | |
return '<span class="caption">' . $content . '</span>'; | |
} | |
add_shortcode( 'caption', 'caption_shortcode' ); | |
// When used like this | |
[caption]My Caption[/caption] | |
// The output would be |
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
// Offset posts by adding offset=1 | |
<?php global $query_string; // required | |
$posts = query_posts($query_string.'&posts_per_page=7&order=DESC'); ?> | |
<?php while(have_posts()) : the_post(); ?> | |
<div id="post"> | |
<h1><?php the_title(); ?></h1> | |
<p style="font-weight: 300;"><?php the_time('F jS, Y'); ?> // |
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 the_post_thumbnail_url(); ?> |
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
UPDATE wp_posts SET post_content=(REPLACE (post_content, '<old url>','<new url>')); | |
/* Replace old image permalinks (for content) in wp_posts table for WORDPRESS */ | |
/* Example: | |
UPDATE wp_posts SET post_content=(REPLACE (post_content, 'inmotiontesting.com','test.inmotiontesting.com')); | |
*/ |
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
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen" /> |
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
//Replace the default WordPress jQuery script with a different one | |
function modify_jquery() { | |
if (!is_admin()) { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3'); | |
wp_enqueue_script('jquery'); | |
} | |
} |