Skip to content

Instantly share code, notes, and snippets.

View muddasirawan's full-sized avatar

Muddasir Abbas muddasirawan

View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PhotoSwipe demo</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Import PhotoSwipe Styles -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.0/photoswipe.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.0/default-skin/default-skin.css">
@muddasirawan
muddasirawan / single-author.php
Created August 31, 2018 15:17 — forked from elvismdev/single-author.php
Combine tax_query and meta_query in WP_Query()
<?php
/**
* This is a kind of rare combination of arguments for WP_Query(), needed in some very special cases.
* This is an already tested snippet code that works!
*/
// Bring post from the global context (if not present already).
global $post;
// Define the post_type's to query for.
$post_types = array( 'event', 'post', 'book' );
@muddasirawan
muddasirawan / functions.php
Created May 20, 2018 20:05 — forked from robincornett/functions.php
optional home.php--to show the posts (blog) page's title and content
<?php
// do NOT include the opening line! Just add what's below to the end of your functions.php file
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' );
function rgc_posts_page_edit_form( $post ) {
$posts_page = get_option( 'page_for_posts' );
if ( $posts_page === $post->ID ) {
add_post_type_support( 'page', 'editor' );
}
@muddasirawan
muddasirawan / basic-function.php
Created April 9, 2018 13:16 — forked from danielpataki/basic-function.php
Adding Theme Options With The Customization API
add_action( 'customize_register' , 'my_theme_options' );
function my_theme_options( $wp_customize ) {
// Sections, settings and controls will be added here
}
@muddasirawan
muddasirawan / .htaccess
Created January 31, 2018 10:37 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(