Skip to content

Instantly share code, notes, and snippets.

@scottnix
scottnix / gist:026c7d32d32ae698503f
Created July 27, 2014 06:05
CSS for Bootsrap 3 Dropdown Menu
.nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
@scottnix
scottnix / gist:9882437
Created March 31, 2014 00:14
Gulp gulpfile.js example configuration with WordPress child theme (Thematic)
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
imagemin = require('gulp-imagemin'),
cache = require('gulp-cache'),
livereload = require('gulp-livereload'),
@scottnix
scottnix / gist:10430003
Last active August 14, 2016 04:38
Gulpfile.js Sample, latest
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
markdown = require('gulp-markdown'),
@scottnix
scottnix / gist:11393024
Created April 29, 2014 07:33
.htaccess used with WordPress sites
# ------------------------------------------------------------------------------
# | Expires headers (for better cache control) |
# ------------------------------------------------------------------------------
# The following expires headers are set pretty far in the future. If you don't
# control versioning with filename-based cache busting, consider lowering the
# cache time for resources like CSS and JS to something like 1 week.
<IfModule mod_expires.c>
@scottnix
scottnix / gist:8077123
Last active January 1, 2016 02:09
Thematic Theme remove #access menu
// reference http://thematictheme.com/forums/topic/removing-thematic_access-only-on-the-front-page/
// remove access from front page and home (usually same page)
function childtheme_override_access() {
if ( !is_front_page() || !is_home() ) { ?>
<div id="access">
<div class="skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip navigation to the content', 'thematic' ); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div><!-- .skip-link -->
<?php
if ( ( function_exists("has_nav_menu") ) && ( has_nav_menu( apply_filters('thematic_primary_menu_id', 'primary-menu') ) ) ) {
echo wp_nav_menu(thematic_nav_menu_args());
@scottnix
scottnix / gist:8051116
Last active December 31, 2015 22:08
Thematic Theme change 404 .entry-title text.
// reference http://thematictheme.com/forums/topic/custom-404/
// change postheader post title for 404 error pages
function childtheme_postheader_posttitle($posttitle) {
if ( is_404() ) {
$posttitle = '<h1 class="entry-title">Some Custom Title</h1>';
}
return $posttitle;
}
add_filter('thematic_postheader_posttitle', 'childtheme_postheader_posttitle');
@scottnix
scottnix / gist:8051050
Last active December 31, 2015 22:08
Thematic Theme override example for custom 404 pages.
// reference http://thematictheme.com/forums/topic/custom-404/
// override 404 content
function childtheme_override_404_content() {
thematic_postheader(); ?>
<div class="entry-content">
<p>Super Awesome Customizations</p>
<p><?php _e( 'Apologies, but we were unable to find what you were looking for. Perhaps searching will help.', 'thematic' ) ?></p>
</div><!-- .entry-content -->
@scottnix
scottnix / gist:7077105
Last active December 26, 2015 02:18
Adding Menu to Thematic Theme Example
// reference http://thematictheme.com/forums/topic/trouble-getting-custom-menu-to-display/#post-3804
// register two additional custom menu slots
function childtheme_register_menus() {
if ( function_exists('register_nav_menu')) {
register_nav_menu('contact-menu', 'Contact Menu');
}
}
add_action('init', 'childtheme_register_menus');
@scottnix
scottnix / gist:6849523
Last active December 24, 2015 19:19
Change Thematic Blog Title to Logo or Image
// replace the site title text with an image that links back to homepage, usually for logos
function childtheme_override_blogtitle() {
?>
<div id="blog-title" class="site-title">
<span>
<a href="<?php echo home_url() ?>/" title="<?php bloginfo('name') ?>" rel="home">
<img src="http://placekitten.com/100/100" alt="<?php bloginfo('name') ?>" />
</a>
</span>
</div>
@scottnix
scottnix / gist:6680736
Last active December 23, 2015 19:09
Remove Thematic Theme options from WP Admin but still allows site info to be modified from default text
// removes the Thematic Theme Options from the WordPress Admin Menu
function childtheme_opt_remove_page() {
remove_action( 'admin_menu', 'thematic_opt_add_page' );
}
add_filter('thematic_child_init', 'childtheme_opt_remove_page');
// modifies the site info text contained in the Theme Options
function childtheme_override_siteinfo() {
echo "Whatever you want";
}