Skip to content

Instantly share code, notes, and snippets.

@NicktheGeek
NicktheGeek / .gitconfig
Created May 11, 2022 19:13
git merge-staging
[alias]
; Pushes any work to current branch
; Sets the remote and the current branch programatically
; Sets the staging branch to second argument or default to develop
; Checks out the staging branch
; Pulls the remote work then pushes
; Checks out the original branch
merge-staging = "!f() { \
git push; \
REMOTE=`git remote`; \
@NicktheGeek
NicktheGeek / style.css
Created January 17, 2019 14:08
center menu
@media only screen and (min-width: 1101px) {
.nav-primary {
text-align: center;
}
.nav-primary .wrap {
display: inline-block;
width: auto !important;
}
}
@NicktheGeek
NicktheGeek / functions.php
Created December 3, 2018 13:35
Add tota11y to WP Theme using WP_DEBUG
<?php
/**
* Theme functions.php file.
*
* This file adds functions to the {theme}.
*
* @package nls
* @author NicktheGeek
* @license GPL-2.0+
* @link http://designsbynickthegeek.com/
@NicktheGeek
NicktheGeek / conditional-actions.php
Created January 18, 2013 17:06
Sometimes you need to add or remove actions conditionally. here is a simple bit of code that allows this to be done within the functions.php file instead of requiring multiple template files.
<?php
add_action( 'genesis_before', 'child_conditional_actions' );
function child_conditional_actions() {
if( /**insert your conditional statements here */ ) {
//put your actions here
}
//you could add additional conditional statements as needed here
@NicktheGeek
NicktheGeek / agentpress.php
Created January 10, 2013 20:27
Change AgentPress feature listing widget output
<?php
add_filter( 'agentpress_featured_listings_widget_loop', 'child_featured_listings_widget_loop' );
/**
* This code will replace the "," left behind in AgentPress feature listing widget after
* the listing detail IDs have been changed.
* Change the IDs to suit your needs.
*/
function child_featured_listings_widget_loop( $loop ){
@NicktheGeek
NicktheGeek / subnav-left-sidebar.php
Last active December 10, 2015 22:38
Ever wanted to add a widget area before the .menu <ul> of the Genesis menus? With this simple gist you can do just that. Included are some comments to allow you to change it to use the primary menu or move the widget area to after the </ul> of the .menu. This gist assumes you have made a sidebar with the ID "subnav-left"
<?php
//You could use genesis_do_nav to target the primary menu
add_filter( 'genesis_do_subnav', 'child_do_subnav_widget', 10, 2 );
/** Adds widget area before the .menu on #subnav */
function child_do_subnav_widget( $subnav_output, $subnav ){
ob_start();
genesis_widget_area( 'subnav-left', array(
'before' => '<div class="subnav-left widget-area">',
'after' => '</div>', //required for HTML5 enabled themes
) );