Skip to content

Instantly share code, notes, and snippets.

View ahmedmusawir's full-sized avatar
:electron:
Working from home

ahmedmusawir

:electron:
Working from home
View GitHub Profile
@ahmedmusawir
ahmedmusawir / gist:c305d4c3e7d6cd4dd62429193b4a58da
Created April 28, 2018 00:19
WP-PLUGINS - ENTRY FOR SETTINGS GENERAL ONLY - FOOTER MESSAGE
/**
*
* Just the general settings
*
*/
function demo_init_theme_options() {
// Define the settings field
add_settings_field(
'footer_message', //The ID (or the name) of the field
@ahmedmusawir
ahmedmusawir / gist:bc3215a5437d2c3d183f74fec189bce1
Created April 12, 2018 07:30
WP - CUSTOM LOGIN PAGE - REDIRECT - NEW - FIXED
<?php
$page_id = "";
$product_pages_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'login.php'
);
$product_pages = get_pages($product_pages_args);
foreach($product_pages as $product_page)
@ahmedmusawir
ahmedmusawir / gist:26bf8e54f260a4f51d95e4b2cb647f8f
Created April 12, 2018 07:27
CUSTOM LOGIN EMPTY PAGE TEMPLATE
<?php
/**
* Template Name: Login Empty Page
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
@ahmedmusawir
ahmedmusawir / gist:d8fe91e8a7958554ad799443c1ecc79c
Created April 12, 2018 07:22
CUSTOM LOGIN FAILED PAGE TEMPLATE
<?php
/**
* Template Name: Login Failed Page
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
@ahmedmusawir
ahmedmusawir / gist:a301261321d270090d44b38e36b5123c
Created March 27, 2018 00:15
VUE JS - EMPTY COMPONENT - FOR COPY PASTE
<template>
<main class="header">
</main>
@ahmedmusawir
ahmedmusawir / gist:b08baeaf4d7e1723a357928ff28467e3
Created March 26, 2018 23:58
VUE JS - SAMPLE COMPONENT - POSTS.VUE - GLOBAL AND LOCAL DECLARATIONS
<template>
<ul>
<li v-for="item in ninjas">{{ item }}</li>
</ul>
</template>
<script>
@ahmedmusawir
ahmedmusawir / gist:c8031e77d11a4b64e6409561759c83cb
Created March 26, 2018 23:46
VUE JS - ROOT COMPONENT - APP.VUE
APP.VUE
<template>
<div id="customer-spa">
<h1>{{ title }}</h1>
<h2>{{ greeting() }}</h2>
<posts></posts>
@ahmedmusawir
ahmedmusawir / gist:ea8b77c03d9bd7d49ad75ccfa0c082d5
Created March 21, 2018 03:25
WP - CUSTOM LOGIN PAGE - LOGIN REDIRECT - LOCK DOWN
<?php
$page_id = "";
$product_pages_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'login.php'
);
$product_pages = get_pages($product_pages_args);
foreach($product_pages as $product_page)
@ahmedmusawir
ahmedmusawir / gist:c263b8faab1d7af9eec86727dcd9e059
Created March 21, 2018 03:21
WP - CUSTOM LOGIN PAGE TEMPLALTE
<?php
/**
* Template Name: Login Page
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
@ahmedmusawir
ahmedmusawir / gist:1eff3fd71d7ab0482a4f6d49785db364
Created March 2, 2018 06:21
WP - WP_QUERY LOOP - W/ CUSTOM POST TYPE & CUSTOM TAXONOMY
<?php
$counter = 0;
$item_count = 0;
$args = array(
'post_type' => 'portfolio',
'tax_query' => array(
array(
'taxonomy' => 'portfolio-item',