Skip to content

Instantly share code, notes, and snippets.

View imuhammadshoaib's full-sized avatar
🎯
Focusing

Muhammad Shoaib imuhammadshoaib

🎯
Focusing
View GitHub Profile
@imuhammadshoaib
imuhammadshoaib / fix-mobile-ment.md
Created September 18, 2018 12:40 — forked from MaruscaGabriel/fix-mobile-ment.md
Add Clickable functioanlities to Divi Collapsing Nested Menu Items

Thank you Stefano Mortellaro for the code!

<style type="text/css">
#main-header .et_mobile_menu .menu-item-has-children > a { background-color: transparent; position: relative; }
#main-header .et_mobile_menu .menu-item-has-children > a:after { font-family: 'ETmodules'; text-align: center; speak: none; font-weight: normal; font-variant: normal; text-transform: none; -webkit-font-smoothing: antialiased; position: absolute; }
#main-header .et_mobile_menu .menu-item-has-children > a:after { font-size: 16px; content: '\4c'; top: 13px; right: 10px; }
#main-header .et_mobile_menu .menu-item-has-children.visible > a:after { content: '\4d'; }
#main-header .et_mobile_menu ul.sub-menu { display: none !important; visibility: hidden !important;  transition: all 1.5s ease-in-out;}
#main-header .et_mobile_menu .visible > ul.sub-menu { display: block !important; visibility: visible !important; }
</style>
@imuhammadshoaib
imuhammadshoaib / hook.php
Created October 4, 2018 12:05
Using a Hook
/**
* Proper way to enqueue scripts and styles
*/
function wpdocs_theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );
@imuhammadshoaib
imuhammadshoaib / vuejs-php.md
Created October 19, 2018 13:40
VueJs and PHP
@imuhammadshoaib
imuhammadshoaib / index.html
Created November 3, 2018 11:18 — forked from gaearon/index.html
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@imuhammadshoaib
imuhammadshoaib / class-wp-bootstrap-navwalker.php
Last active June 3, 2024 08:29
Make parent link clickable in Bootstrap with Wordpress NavWalker
//FROM
$atts['href'] = '#';
$atts['data-toggle'] = 'dropdown';
$atts['aria-haspopup'] = 'true';
$atts['aria-expanded'] = 'false';
$atts['class'] = 'dropdown-toggle nav-link';
$atts['id'] = 'menu-item-dropdown-' . $item->ID;
//TO
@imuhammadshoaib
imuhammadshoaib / wp_smoothstate.js
Created December 29, 2018 10:19
SmoothState.js WordPress options example.
jQuery(function(){
'use strict';
var options = {
prefetch: true,
blacklist: '.no-smoothState', //Disable Cash on this class
allowFormCaching: false, //By Deafult
anchors: 'a', //By Deafult
forms: 'form', //By Deafult
cacheLength: 5,
onStart: {
@imuhammadshoaib
imuhammadshoaib / gist:a671710079695d9c8d49bf9bc3d7212d
Created January 4, 2019 06:59 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@imuhammadshoaib
imuhammadshoaib / index.html
Created January 28, 2019 14:10
Prefetching Techniques
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<link rel="dns-prefetch" href="//soorajchandran.me">
@imuhammadshoaib
imuhammadshoaib / deploy.php
Created March 11, 2019 10:59 — forked from oxguy3/deploy.php
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@imuhammadshoaib
imuhammadshoaib / index.php
Created March 26, 2019 15:01
WordPress Shortcode
function get_adsense($atts) {
return '<script type="text/javascript"><!--
google_ad_client = "pub-546321545321589";
/* 468x60, created 9/13/10 */
google_ad_slot = "54321565498";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"