Skip to content

Instantly share code, notes, and snippets.

View huzaifaarain's full-sized avatar
🌎
[email protected]://~ workspace

Huzaifa Saif-ur-Rehman huzaifaarain

🌎
[email protected]://~ workspace
View GitHub Profile
@huzaifaarain
huzaifaarain / readme.md
Last active December 4, 2018 12:47
Git Push From One Working Directory To Remote Working Directory Without Bare Repository

GIT: PUSH TO REMOTE WORKING DIRECTORY

In this gist we are about to push changes from one working directory to another working directory without bare repository

Lets name our directories one_working , second_working.

Lets create the one_working directory

mkdir one_working
cd one_working

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@huzaifaarain
huzaifaarain / Custom_Theme_Logo.md
Last active December 2, 2018 13:40
Displaying the custom logo in your theme

Displaying the custom logo in your theme

A custom logo can be displayed in the theme using the_custom_logo() function. But it’s recommended to wrap the code in a function_exists() call to maintain backward compatibility with the older versions of WordPress, like this:

if ( function_exists( 'the_custom_logo' ) ) {
    the_custom_logo();
}

Generally logos are added to the header.php file of the theme, but it can be elsewhere as well.

If you want to get your current logo URL (or use your own markup) instead of the default markup, you can use the following code:

@huzaifaarain
huzaifaarain / Customize WP Nav Markup
Last active December 2, 2018 13:27
How to customize the markup of WP Navigation
add_filter('nav_menu_css_class', function($classes, $item, $args) {
if($args->theme_location == 'location') {
$classes[] = 'list-inline-item';
}
return $classes;
}, 1, 3);
add_filter( 'nav_menu_link_attributes', function( $atts, $item, $args ) {
if($args->theme_location == 'location') {