Skip to content

Instantly share code, notes, and snippets.

View tsquez's full-sized avatar

Thomas E Vasquez tsquez

View GitHub Profile
@tsquez
tsquez / WordPress Admin Footer
Last active July 3, 2017 14:52
If you are building a WordPress theme for your clients using WP-Forge and a child theme and you want to promote your company in your theme, one of the easiest ways to do it is to create a custom WordPress admin footer. Simply add the following to your child theme functions.php file (Make sure to copy everything between <?php and closing ?>):
@tsquez
tsquez / multiple-progress-bars.txt
Last active December 28, 2015 12:29
Foundation Progress Bars - Learn how to add Foundation Progress Bars to your content
<div class="progress"><span class="meter" style="width: 20%"></span></div>
<div class="progress success"><span class="meter" style="width: 40%"></span></div>
<div class="progress alert"><span class="meter" style="width: 60%"></span></div>
<div class="progress secondary"><span class="meter" style="width: 80%"></span></div>
@tsquez
tsquez / top-bar
Last active August 29, 2015 14:07
If you want to change the look of the top-bar in foundation, these are the main elements you need to adjust. They appear in order. I changed the default colors as an example.
.top-bar { /* main color of the top-bar */
background: #333333;
}
.top-bar-section > ul > .divider, .top-bar-section > ul > [role="separator"] { /* color of the divider */
border-right: solid 1px #4e4e4e;
}
.top-bar-section ul li {
background: #333333;
}
.top-bar-section li:not(.has-form) a:not(.button),
@tsquez
tsquez / Orbit Data Options
Last active August 29, 2015 14:08
How to set data-options for Orbit without using javascript
animation: 'slide', // Sets the type of animation used for transitioning between slides, can also be 'fade'
timer_speed: 10000, // Sets the amount of time in milliseconds before transitioning a slide
pause_on_hover: true, // Pauses on the current slide while hovering
resume_on_mouseout: false, // If pause on hover is set to true, this setting resumes playback after mousing out of slide
next_on_click: true, // Advance to next slide on click
animation_speed: 500, // Sets the amount of time in milliseconds the transition between slides will last
stack_on_small: false,
navigation_arrows: true,
slide_number: true,
slide_number_text: 'of',
@tsquez
tsquez / clean-up-wphead
Last active December 10, 2015 14:25
This will remove a lot fo unnecessary junk from the header
if ( ! function_exists( 'wpforge_head_clean' ) ) :
function wpforge_head_clean() {
// Remove the links to the extra feeds such as category feeds
remove_action( 'wp_head', 'feed_links_extra', 3 );
// Remove the links to the general feeds: Post and Comment Feed
remove_action( 'wp_head', 'feed_links', 2 );
// Remove the link to the Really Simple Discovery service endpoint, EditURI link
remove_action( 'wp_head', 'rsd_link' );
// Remove the link to the Windows Live Writer manifest file.
remove_action( 'wp_head', 'wlwmanifest_link' );
@tsquez
tsquez / remove-actions
Last active August 29, 2015 14:19
Remove parent functions in WP-Forge
function your_function_name() {
remove_action( 'action name goes here' );
}
add_action( 'after_setup_theme', 'your_function_name', 9 );
@tsquez
tsquez / if_function_exists
Created April 18, 2015 14:29
Wrap functions in "if function_exists" statement
if ( ! function_exists( 'function_name_goes_here' ) ) {
/* function goes here */
}
@tsquez
tsquez / get_stylesheet.php
Created August 8, 2015 23:35
use this to load a script or a style that is in a child theme
get_stylesheet_directory_uri()
@tsquez
tsquez / Off-Canvas WordPress Menu Output
Last active August 29, 2015 14:27 — forked from zzramesses/Off-Canvas WordPress Menu Output
Foundation Off-Canvas WordPress Menu (forked so I do not lose it)
<aside class="left-off-canvas-menu">
<?php wp_nav_menu(
array(
'theme_location' => 'the menu you want to use',
'container' => false,
'menu_id' => '',
'menu_class' => 'off-canvas-list',
'walker' => new Off_Canvas_Walker()
)
);
@tsquez
tsquez / sidebar social menu code
Created September 2, 2015 09:55
Adds screen reader span class to elements of menu in main sidebar
// Adds screen reader span class to elements of menu in main sidebar
jQuery('#secondary .menu a').each(function()
{
jQuery(this).wrapInner('<span class="screen-reader-text"></span>');
});