Skip to content

Instantly share code, notes, and snippets.

@scottnix
scottnix / svg.php
Created September 19, 2015 04:55
Thematic Theme SVG Icons
// override post footer to add SVG icons, pulls from /icon/ folder inside the child theme
function childtheme_override_postfooter() {
$post_type = get_post_type();
$post_type_obj = get_post_type_object($post_type);
$tagsection = get_the_tags();
// Display nothing for "Page" post-type
if ( $post_type == 'page' ) {
$postfooter = '';
@scottnix
scottnix / gist:48f0f3091672e97ff659
Created July 14, 2015 05:31
Thematic Header Image Link
#blog-title a {
display: block;
height: 200px;
width: 100%;
background: url('http://localhost/githubs/test/wp-content/uploads/sites/12/2015/07/cropped-300.jpg');
margin: 0;
padding: 0;
text-indent: -9999px; /* hides blog name, remove if you want the blog text */
}
#blog-description {
@scottnix
scottnix / gist:d7cce2dce70fe3915b0e
Created July 13, 2015 20:32
Move Thematic Menu to the Top
// remove menu from current position
function childtheme_move_access() {
remove_action('thematic_header', 'thematic_access', 9);
}
add_action('thematic_child_init', 'childtheme_move_access');
// add menu back into the same header, but on a different priority
add_action('thematic_header', 'thematic_access', 0);
@scottnix
scottnix / email body
Last active August 29, 2015 14:17
Contact Form 7
From: [your-name] <[your-email]>
Website: [your-website]
Message Body:
[your-message]
--
This e-mail was sent from a contact form on Scott Nix (http://scottnix.com)
@scottnix
scottnix / gist:4ffda6c4eb11be1b6a7d
Created September 12, 2014 05:39
Thematic Theme WordPress SEO Breadcrumbs
function childtheme_yoast_seo_breadcrumbs() {
if ( is_page() && function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
}
add_action('thematic_abovecontainer', 'childtheme_yoast_seo_breadcrumbs');
@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:a6fd7fd6fda2cab56e41
Created July 27, 2014 05:54
Sass for Bootstrap 3 Dropdown Menu
//
// Bootstrap 3 Variables
// This is an incomplete list of bootstrap variables, lists only what pertains to the dropdown menu and various possible options.
//
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
@scottnix
scottnix / gist:7f0175ba607117b1e139
Created July 25, 2014 21:59
Bootstrap.js files required for dropdown menu
/* ========================================================================
* Bootstrap: dropdown.js v3.2.0
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
@scottnix
scottnix / functions.php
Created June 20, 2014 05:14
Thematic Category Styling Example
// changes the "Page Title" on Categories to Blog
function childtheme_page_title($content) {
if ( is_category('') ) {
// if ( is_category('aciform') ) { // if you want to target a specific category, target it by name 'aciform'
$content = '<h1 class="page-title">';
// $content .= ' <span>' . single_cat_title('', FALSE) .'</span>'; // calls the actual category name, if you need it for something
$content .= ' <span>Blog</span>';
$content .= '</h1>' . "\n";
}
return $content;
@scottnix
scottnix / gist:d08ecdb091582cc046ca
Created June 20, 2014 01:16
Thematic Theme Add Logo Image to Header
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/300/150">
</a>
</span>
</div>