Skip to content

Instantly share code, notes, and snippets.

View leoj3n's full-sized avatar
:octocat:
Edit status

Joel Kuzmarski leoj3n

:octocat:
Edit status
  • Drinking coffee somewhere.
View GitHub Profile
<div class="row" style="color:#f0f0f0;">
<div id="foo" class="span4 bar">
<div class="apply-bg-here">
<h3>Box 1 Title</h3>
<div class="textwidget">
Put a lot of info here like the font should be #f0f0f0 and the background should be #232728 and that lipsum cume laude is greek for taking up space.
</div>
</div>
</div> <!-- END SPAN 4 -->
@leoj3n
leoj3n / gist:3691661
Created September 10, 2012 15:45
replace "Home" link in primary nav with an icon
// replace "Home" link in primary nav with an icon
add_filter( 'walker_nav_menu_start_el', 'pp_walker_nav_menu_start_el', 11, 4 );
function pp_walker_nav_menu_start_el( $item_output, $item, $depth, $args ) {
if (($args->theme_location == 'primary_navigation') && ($item->title == 'Home')) {
$domDocument = new DOMDocument();
$domDocument->loadHTML($item_output);
$domElement = $domDocument->createElement('i', '');
$domElement->setAttribute('class', 'icon-home icon-large');
$item = $domDocument->getElementsByTagName('a')->item(0);
@leoj3n
leoj3n / Hack for @pippinsplugins
Created September 2, 2012 01:44
Pippins' question: An a WP site, adding query args like this /checkout/?an_action=this is causing 404 errors. Doesn't matter what query arg. Ideas?
// a possible workaround
function my_add_rewrites($content) {
global $wp_rewrite;
$new_non_wp_rules = array(
site_url('checkout/(*)') => plugins_url('checkout.php?$1');
);
$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules);