Skip to content

Instantly share code, notes, and snippets.

@omurphy27
omurphy27 / HTAccess redirectmatch 301 - redirecting entire directories.htaccess
Created January 25, 2014 00:02
HTAccess redirectmatch 301 - redirecting entire directories.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RedirectMatch 301 ^/nba/.*$ http://oddsfather.com/
@jnowland
jnowland / freemember-bday-selectors.php
Created July 23, 2013 06:06
Select boxes for birthday in freemember echos out bday_d , bday_m, bday_y for expression engine. Works with PHP on output.
<div class="control-group">
<label for="{pr_form_id}-date-of-birth">Date of Birth</label>
<select id="{embed:form_prefix}-bday_d" name="bday_d" class="dob-day">
<option value="">Day</option>
<?php for ($i=1; $i < 32; $i++) : ?>
<option value="<?php echo $i ?>"
<?php echo ($i == "{bday_d}") ? 'selected="selected"' : "" ?>
>
<?php echo $i ?></option>
@kopepasah
kopepasah / archive-post-type.php
Created July 17, 2012 22:42
Order Custom Post Type Archive by Taxonomy in WordPress
<?php
/**
* Template for ordering custom post types by terms on
* on the post types archive.php
*
* @package WordPress
* @author Justin Kopepasah
*
*/
@jo-snips
jo-snips / events-conditional-wrappers.php
Last active December 21, 2023 12:27
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream