Skip to content

Instantly share code, notes, and snippets.

@besimhu
besimhu / Rewrite Author Slug.php
Created March 15, 2015 16:07
For when you want something other than /author
// Rewrite author slug
function change_author_permalinks() {
global $wp_rewrite;
$wp_rewrite->author_base = 'people';
$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base. '/%author%';
}
add_action('init','change_author_permalinks');
@besimhu
besimhu / Media Query Snippet (SCSS)
Created March 15, 2015 16:16
Snippet to write out media queries faste. Go to 'Tools -> New Snippet' to add your snippet. Use by typing 'mq' followed by Tab until it's filled out.
<snippet>
<content><![CDATA[
@include mq(${1}) {
${2}
}
]]></content>
<tabTrigger>mq</tabTrigger>
</snippet>
@besimhu
besimhu / @include rem() mixin snippet
Last active August 29, 2015 14:17
Enables the use of rem mixin. This mixin takes two values, the first being a css property, and the second being your size values. You're able to use any unit you desire, and it will convert it over. Please note that this mixin also comes with a pixel fallback, and this mixin mostly comes in handy when you are needing to have IE8 support, but sti…
<snippet>
<content><![CDATA[
@include rem(${1}, ${2});
]]></content>
<tabTrigger>rem</tabTrigger>
</snippet>
@besimhu
besimhu / em() function snippet
Created March 15, 2015 16:28
Snippets to use em() function. Simply go to 'Tools -> New Snippet' and add your snippets in. To use hit tab after writing 'em'.
<snippet>
<content><![CDATA[
em(${1});
]]></content>
<tabTrigger>em</tabTrigger>
</snippet>
@besimhu
besimhu / rem() function snippet
Created March 15, 2015 16:29
Snippets to use rem() function. Simply go to 'Tools -> New Snippet' and add your snippets in. To use hit tab after writing 'rm'
<snippet>
<content><![CDATA[
rem(${1});
]]></content>
<tabTrigger>rm</tabTrigger>
</snippet>
// Markup Sample
<img src="<?php echo $image[0]; ?>"
width="<?php echo $image[1]; ?>"
height="<?php echo $image[2]; ?>"
alt="<?php echo $image_alt; ?>" />
// Markup Sample (Media Query Sync)
<figure>
<img class="responsive"
src="<?php echo $media_sml[0]; ?>"
// Markup
<img src="<?php echo $src; ?>"
alt="<?php echo $alt; ?>"
width="<?php echo $width; ?>"
height="<?php echo $height; ?>" />
/**
* Generate image markup through WP function.
*
* Requires ACF setting of ID.
* The crop can be custom, or one of WP default ones, or leave empty.
*
* This method does not work great with Media Query Sync. However, this method
* allows you to define custom settings, and the width, height, and alt tags will
* be auto generated for you. Which is great for semantics.
*
<body>
<header class="global-header">
<nav>
<ul>
<li><a href="#" title="">Nav Item</a></li>
<li><a href="#" title="">Nav Item</a></li>
<li><a href="#" title="">Nav Item</a></li>
</ul>
</nav>
</header>