Skip to content

Instantly share code, notes, and snippets.

View niamrox's full-sized avatar

Niamul Hasan niamrox

View GitHub Profile
@niamrox
niamrox / abstract.php
Created February 2, 2019 07:43 — forked from zanematthew/abstract.php
The abstract class for creating Custom Post Types
<?php
/**
*
* This is used to regsiter a custom post type, custom taxonomy and provide template redirecting.
*
* This abstract class defines some base functions for using Custom Post Types. You should not have to
* edit this abstract, only add additional methods if need be. You must use what is provided for you
* in the interface.
*
*/
@niamrox
niamrox / meta-tags.md
Created May 22, 2018 22:34 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@niamrox
niamrox / Python3 Virtualenv Setup.md
Created April 24, 2018 08:39 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@niamrox
niamrox / gist:6e39ff40558d371b3e8bf8e6f9ce240d
Created October 23, 2017 17:56 — forked from jchamb/gist:fdf7d12b0191cb852056
Woocommerce Free Downloads without checkout
function direct_free_downloads_button($button)
{
global $product;
if( $product->is_downloadable() AND $product->get_price() == 0 )
{
$files = $product->get_files();
$files = array_keys($files);
$download_url = home_url('?download_file='.$product->id.'&key='.$files[0].'&free=1' );
@niamrox
niamrox / supposition.js
Created August 27, 2017 07:24 — forked from joeldbirch/supposition.js
Updated version of Supposition. This version is compatible with Superfish 1.6+. See this ancient page for description, example and caveats: http://users.tpg.com.au/j_birch/plugins/superfish/supposition-test/
/*
* Supposition v0.3a - an optional enhancer for Superfish jQuery menu widget
*
* Copyright (c) 2013 Joel Birch - based on work by Jesse Klaasse - credit goes largely to him.
* Special thanks to Karl Swedberg for valuable input.
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
@niamrox
niamrox / gist:32a869041e306f8ef86f5ebbadbbc1f0
Created July 30, 2017 15:33 — forked from mikejolley/gist:1860056
WooCommerce - Override billing fields
add_filter( 'woocommerce_billing_fields', 'custom_woocommerce_billing_fields' );
function custom_woocommerce_billing_fields( $fields ) {
// Over-ride a single label
$fields['billing_first_name']['label'] = 'Your label';
// Over-ride a single required value
$fields['billing_first_name']['required'] = false;
<?php
/**
* Get all type posts
*
* @return void
* @author alispx
**/
function alispx_get_type_posts_data( $post_type = 'post' ) {
@niamrox
niamrox / gist:102f2a2857b1b00aaf6c71ebbf47ce85
Created April 24, 2017 10:57 — forked from bueltge/gist:757903
This WordPress Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine
<?php
/*
Plugin Name: HowTo Plugin
Plugin URI:
Description: This Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine
Author: Heiko, Frank
Author URI: http://bueltge.de
Version: 0.1
License:
@niamrox
niamrox / wp-query-ref.php
Created November 30, 2016 10:04 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(