Skip to content

Instantly share code, notes, and snippets.

@awakekat
awakekat / wpadminfooter.txt
Created April 28, 2016 22:04
Wordpress Admin Footer Text
// Change Footer in Admin
function awakekat_footer_admin () {
echo 'Theme designed and Developed by <a href="http://awakekat.com" "target=_blank">Awakekat</a> and powered by <a href="http://wordpress.org" "target=_blank">Wordpress</a>.';
}
add_filter('admin_footer_text', 'awakekat_footer_admin');
.blogCommentHeading {
font-family: 'Helvetica Neue', Arial, Helvetica;
margin: 0 0 10px 0;
padding: 0 0 0 6px;
/* background: url('../images/common/blog/blog-comment-header.png?1462478500') no-repeat 0 -48px; */
}
.blogCommentHeading .blogCommentHeadingInner {
height: 40px;
/* background: url('../images/common/blog/blog-comment-header.png?1462478500') repeat-x 0 0; */
@awakekat
awakekat / bracketsSass.txt
Created May 6, 2016 16:19
.brackets.json file for Sass plugin
{
"path": {
"css/style.scss": {
"sass.enabled": true,
"sass.options": {
"outputDir": "../css/",
"imagePath": null,
"sourceComments": "map",
"outputStyle": "compressed"
}
@awakekat
awakekat / private_redirect.txt
Created May 13, 2016 20:17
WP Private Page Redirect
<?php
add_action('template_redirect', 'private_content_redirect_to_login', 9);
function private_content_redirect_to_login() {
global $wp_query,$wpdb;
if (is_404()) {
$private = $wpdb->get_row($wp_query->request);
$location = wp_login_url($_SERVER["REQUEST_URI"]);
if( 'private' == $private->post_status ) {
wp_safe_redirect($location);
exit;
@awakekat
awakekat / SkeletonSiteInstall.txt
Last active February 19, 2017 15:11
5 second install of site with Bootstrap and Font Awesome ready for preprocessing. Place into .zshrc file if using OhMyZsh. Jade and SCSS flavored.
alias skel="mkdir js css jade scss images; touch index.html; bower install bootstrap fontawesome; cp bower_components/bootstrap/dist/css/bootstrap.min.css css; cp bower_components/bootstrap/dist/js/bootstrap.min.js js; cp bower_components/jquery/dist/jquery.min.js js; cp bower_components/font-awesome/css/font-awesome.min.css css; mkdir fonts; cp bower_components/font-awesome/fonts/* fonts; cd css; touch style.css; cd ../; cd jade; touch index.jade; mkdir templates; cd templates; touch docwrapper.jade; cd ../../; cd scss; touch style.scss; mkdir partials; cd partials; touch _vars.scss _mixins.scss; cd ../../;"
@awakekat
awakekat / acf_if.txt
Created June 6, 2016 00:39
Advanced Custom Fields If statement
<?php
// check if the repeater field has rows of data
if( have_rows('repeater_field_name') ):
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
else :
// no rows found
<?php if( have_rows('repeater_field_name') ): ?>
<ul class="slides">
<?php while( have_rows('repeater_field_name') ): the_row();
// vars
$image = get_sub_field('image');
$content = get_sub_field('content');
$link = get_sub_field('link');
?>
<li class="slide">
<a href="<?php echo $link; ?>">
@awakekat
awakekat / Paged loop
Created July 31, 2016 21:05
Wordpress Paged Loop
<?php
/*
Template Name: Loop Template
*/
get_header(); ?>
<div class="pg-wrapper">
<!-- Page Structure -->
<h2><?php the_title(); ?></h2>
@awakekat
awakekat / function.php
Created August 1, 2016 21:39
Register Menu in functions.php
<?php
/*
* Register Menu in functions.php
*/
add_action( 'after_setup_theme', 'register_my_menu' );
function register_my_menu() {
register_nav_menu( 'primary', __( 'Primary Menu', 'theme-slug' ) );
}
@awakekat
awakekat / wpclasses.txt
Created August 13, 2016 14:17
Wordpress Style Classes
# Body Styles
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}
.paged {}
.attachment {}
.error404 {}