Skip to content

Instantly share code, notes, and snippets.

@michaelcarwile
michaelcarwile / bs-navbar-brand-svg.html
Last active May 9, 2021 15:02
Bootstrap navbar-brand with inline .svg
<a class="navbar-brand">
<svg
class="svg-brand"
viewBox="0 0 450 100"
preserveAspectRatio="xMidYMin"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs></defs>
@michaelcarwile
michaelcarwile / wp-query-ref.php
Created March 31, 2016 05:00 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@michaelcarwile
michaelcarwile / .dotfiles
Last active October 28, 2015 16:04
. files
Container for .files.
@michaelcarwile
michaelcarwile / icon-bg-text-replacement.scss
Last active October 14, 2015 01:11
Font icon as background-image text-replacement.
.icon-bg {
width: 32px; /* required for layout, adjust as needed */
a {
margin-top: -60%; /* adjust as needed */
overflow: hidden; /* required for replacement */
padding-left: 0;
padding-right: 0;
position: relative;
text-indent: 100%;
&:after {
@michaelcarwile
michaelcarwile / permsfix.sh
Created January 30, 2015 12:47
Permissions Fix
#!/bin/bash
sudo chown -R www-data:www-data /var/www/
sudo chmod -R g+w /var/www/
@michaelcarwile
michaelcarwile / functions.php
Created October 5, 2014 11:53
Modify text strings in WordPress
<?php
//* Modify text strings
//* Hat-tip: http://speakinginbytes.com/2013/10/gettext-filter-wordpress/
function dw_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'More T-Shirts', 'woocommerce' );
break;
@michaelcarwile
michaelcarwile / gist:d8cb39005fb2caa18764
Created September 10, 2014 15:05
Split and capitalize names in Google Spreadsheet
// if cell to split is C2
=split(proper(C2), " ")
@michaelcarwile
michaelcarwile / functions.php
Created August 27, 2014 01:37
Genesis top bar area
<?php
// *copy below this line
//* Add top bar to site (loads above header and everything else)
add_action( 'genesis_before', 'top_bar' );
function top_bar() { ?>
<div id="top-bar-area">
<div class="wrap">
<!-- custom content here -->
</div>
@michaelcarwile
michaelcarwile / functions.php
Created August 15, 2014 12:06
Gravity Forms Submit Button Add CSS Class
<?php
//* Copy below this line */
add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );
function form_submit_button($button, $form) {
return '<input type="submit" class="button custom-class-here" id="gform_submit_button_' . $form['id'] . '" value="' . $form['button']['text'] . '">';
}
@michaelcarwile
michaelcarwile / gist:10923908
Last active August 29, 2015 13:59
Featured image check if featured image exists and place on theme for WordPress Genesis child theme.
<?php
//* don't copy opening php tag above
//* Add featured image to top of posts
add_action('genesis_before_entry', 'featured_post_image', 8);
function featured_post_image() {
if (has_post_thumbnail()) : ?>
<div class="featured-image">
<?php the_post_thumbnail('post-image'); ?>