Skip to content

Instantly share code, notes, and snippets.

@sjaved87
sjaved87 / admin-custom-css.php
Last active August 30, 2016 10:00
Remove the default WordPress admin-bar.css file and replace it with your own custom one located in your active theme or child theme. You can remove and replace other admin css files too using the same method if you know the css handle.
<?php
function sjaved_remove_and_replae_admin_bar_stylesheet(){
//Remove the existing stylesheets
wp_dequeue_style( 'admin-bar' );
wp_deregister_style( 'admin-bar' );
//Enque the custom CSS file from your current theme or child theme
wp_enqueue_style( 'custom-admin-bar', get_stylesheet_directory_uri() . '/custom-admin-bar.css', false, '1.0.0' );
@sjaved87
sjaved87 / custom.css
Created August 26, 2016 16:42
For a specific member in forum.
[data-style='burger'] ul.menu {
background: #FFBA00;
}
.responsive_nav_toggler {
border: 0px solid #FFFFFF;
}
.responsive_nav_toggler > div {
background: #1900d3;
}
.responsive_nav_toggler:hover {
@sjaved87
sjaved87 / page-blank.php
Last active August 20, 2016 08:53
This is blank template page. It will also take care of header and footer scripts :)
<?php
/**
* Template Name: Blank Page
*
* A blank custom page template.
*
* Author - Sajid Javed
*
* The "Template Name:" bit above allows this to be selectable
* from a dropdown menu on the edit page screen.
/*Optional: You can optionally change the register text e.g. Signup*/
$register_text = 'Register';
@sjaved87
sjaved87 / register_link.php
Last active August 9, 2016 20:13
(for tutorial only)
@sjaved87
sjaved87 / phptag.php
Created August 9, 2016 20:10
PHP opening tag (used for tutorials in my posts)
<?php
@sjaved87
sjaved87 / custom_register_link.php
Last active August 10, 2016 13:23
Using this snippet you can change the default register link with your custom registration page link (created by GF form user registration add-on) and also optionally change the "Register" text.
@sjaved87
sjaved87 / ms_redirect_to_referrer_after_login.php
Created June 23, 2016 11:09
[Membership 2 Pro Plugin] The following mu-plugin/snippet will redirect user back to the page from where they cam from after login.
<?php
function ms_redirect_to_referrer_after_login( $defaults ){
$referrer = wp_get_referer();
if( $referrer ){
$defaults['redirect_login'] = $referrer;
}
@sjaved87
sjaved87 / style.css
Last active June 22, 2016 12:46
A sample of child theme style.css file. This is for TwentySixteen theme.
/*
Theme Name: Twenty Sixteen Child Theme
Theme URI: http://www.sajidjaved.com/
Description: A Twenty Sixteen child theme
Author: Sajid
Author URI: http://www.sajidjaved.com
Template: twentysixteen
Version: 1.0.0
*/