Skip to content

Instantly share code, notes, and snippets.

View priscillamc's full-sized avatar

Priscilla Chapman priscillamc

View GitHub Profile
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "."
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
# To enable sourcemap output, set this to true
@priscillamc
priscillamc / bs-config.json
Created March 17, 2017 16:41
Open Angular project in Chrome instead of default browser.
{
"browser" : "chrome"
}

Display Featured Image, if exists (in loop)

if ( has_post_thumbnail() ){
    the_post_thumbnail();
}

Display theme image

<img src="<?php echo get_styleshet_directory_uri(); ?>/images/logo.png" class="" alt="" />
@priscillamc
priscillamc / wp-theme-checklist.md
Last active June 29, 2017 13:01
Theme update checklist

Code

-[ ] Removed debugging code (error_log, console.log, var_dump, dbgx_trace_var)

Convert line endings

Convert to Unix: :set ff=unix Convert to Windows: :set ff=dos

Save and close

:wq

Edit file

i

@priscillamc
priscillamc / git-email-fix
Created April 15, 2015 13:33
Git fix email settings in branch
git config --global user.email
git config --global user.email "username@users.noreply.github.com"
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "email@example.com" ];
then
GIT_AUTHOR_NAME="username";
GIT_AUTHOR_EMAIL="username@users.noreply.github.com";
git commit-tree "$@";
@priscillamc
priscillamc / wp-hide-customizer-admin-links
Created August 13, 2015 21:13
Remove WordPress Customizer links from the Admin Toolbar and dashboard by changing the body class back to 'no-customize-support'. This is a way to show only the original admin toolbar links for themes that don't support the Customizer.
@priscillamc
priscillamc / gitignore
Last active April 22, 2019 06:59
Common gitignore
Thumbs.db
.DS_Store
*.orig
node_modules
.npm-debug.log
@priscillamc
priscillamc / wp-add-inline-scripts.md
Last active October 4, 2019 14:53
Adding inline javascript in WordPress 4.5+ using wp_add_inline_script()

Adding Inline Scripts in WordPress

Since WordPress 4.5, you can add the inline JavaScript using the wp_add_inline_script() function. This can be used instead of echoing inline scripts using wp_footer. The first argument is the handle of a registered script, in this case 'pretty-photo'.

function add_styles_scripts(){
	// Add script in the footer
	wp_enqueue_script('pretty-photo', get_stylesheet_directory_uri() . '/.../jquery.prettyPhoto.js', 
		array('jquery'), NULL, true);