Skip to content

Instantly share code, notes, and snippets.

/* #Media Queries
================================================== */
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-width : 320px) and (max-width : 480px) {}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {}
/* Smartphones (portrait) ----------- */
@jeffcdavis
jeffcdavis / include-wordpress.php
Created March 15, 2013 01:28
Load WordPress database/functions outside of WordPress
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('/website-root-directory/wp-load.php');
?>
@mattnorris
mattnorris / navbar-left-right.html
Created March 9, 2013 14:28
Left-justified Twitter Bootstrap nav options along with right-justified; collapsible menu for mobile devices is also illustrated.
<!--
Navbar
Source: http://twitter.github.com/bootstrap/
-->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<!-- Expand button for smaller devices -->
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
@chilinaz
chilinaz / ie.css
Created February 19, 2013 06:29
CSS: Old IE Fixes (mixed bag)
/* Fixes for Internet Explorer CSS - ie.css */
/* png fix for IE6 and lower
------------------------------------ */
* html #selector {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='img/image.png');
background-image: none;
background-repeat: no-repeat;
<?php
/*
Addon Name: Free subscriptions gateway
Author: Barry (Incsub)
Author URI: http://caffeinatedb.com
Gateway ID: freesubscriptions
*/
class freesubscriptions extends M_Gateway {
if ( ! function_exists( 'wp_new_user_notification' ) ) :
function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {
return
}
endif;
@mikeschinkel
mikeschinkel / child-class-plugin-loader.php
Last active December 11, 2015 09:59
Answering the question on Quora: "How do I specify the loading order of plugins?" by changing the question to "How do you ensure that you declare your child class after the plugin's class is declared?" - http://www.quora.com/WordPress-Plugin-Development/How-do-I-specify-the-loading-order-of-plugins. Note I've boiled this example down to its bare…
<?php
/**
* class_exists() is a fail-safe.
*/
if ( ! class_exists( 'Parent_Class_Plugin' ) )
return;
class Child_Class_Plugin extends Parent_Class_Plugin {
// Your plugin code goes here.
@tkowalczyk
tkowalczyk / To admin only
Created January 16, 2013 11:33
This gist allow using http://wordpress.org/extend/plugins/private-messages-for-wordpress/ plugin for sending private messages only to Administrator from users. Source code of send-page.php of this plugin.
<?php
/**
* Send form page
*/
function rwpm_send()
{
global $wpdb, $current_user;
?>
<div class="wrap">
<h2><?php _e( 'Send Private Message', 'pm4wp' ); ?></h2>
@RalfAlbert
RalfAlbert / membersince.php
Created January 1, 2013 13:35
WordPress: Show date of registration in user profile
<?php
namespace ShowMemberSince;
add_action( 'plugins_loaded', 'ShowMemberSince\init' );
/**
* Adding needed action hooks
*/
function init(){