Skip to content

Instantly share code, notes, and snippets.

@decodigo
decodigo / config.rb
Last active December 20, 2015 04:48
Simple Wordpress SASS config file.
http_path = "/"
css_dir = "."
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
preferred_syntax = :scss
output_style = :compressed
relative_assets = true
@decodigo
decodigo / functions.php
Created July 16, 2013 16:27
Snippet to show which template is currently being used.
<?php
add_action('wp_footer', 'show_template');
function show_template() {
global $template;
echo '<div style="width: 50%; margin: 40px auto; font-size: 12px; color: #c09853; background-color: #fcf8e3; border: 1px solid #fbeed5;padding: 2em; border-radius: 4px;"><p><strong>Current Template</strong></p><em>';
print_r(str_replace(get_template_directory(), '', $template) );
echo '</em></div>';
}
@decodigo
decodigo / functions.php
Last active December 19, 2015 19:08
Loop through a widgets directory and dynamically include them.
<?php
//Loop through each file in the Widgets directory and include it.
foreach ( glob( get_template_directory_uri() . "/widgets/*.php", GLOB_NOSORT) as $filename ){
include $filename;
}
?>