Skip to content

Instantly share code, notes, and snippets.

View Xtremefaith's full-sized avatar
:bowtie:
I may be slow to respond.

Nick Worth Xtremefaith

:bowtie:
I may be slow to respond.
View GitHub Profile
@Xtremefaith
Xtremefaith / div-framework_redirect-navigation-logo.php
Last active October 1, 2015 23:51
By default the Div Framework navigation logo links to the home page, but if you want to redirect it to a custom link you would add this filter in the functions.php of your child theme.
/**
* REDIRECT NAVIGATION LOGO
* Used to redirect the navigation logo to a custom link
*/
add_filter( 'nav_logo', function($s){
$pattern = "/(?<=href=(\"|'))[^\"']+(?=(\"|'))/";
return preg_replace($pattern,$new_url,$s);
});
@Xtremefaith
Xtremefaith / Intro to Grunt.md
Last active August 29, 2015 14:10
Grunt Setup
@Xtremefaith
Xtremefaith / Blank-Search.php
Last active August 29, 2015 13:57
Want to redirect a user who enters a blank search request, here is a snippet to help with that.
add_filter( 'request', 'my_request_filter' );
function my_request_filter( $query_vars ) {
if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) {
$query_vars['s'] = " ";
}
return $query_vars;
}