Skip to content

Instantly share code, notes, and snippets.

@arelthia
arelthia / rewritehtaccess
Created December 23, 2013 19:16
Remove php extension
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
@arelthia
arelthia / 0_reuse_code.js
Created December 23, 2013 17:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@arelthia
arelthia / ppc4Widget- Content
Last active December 20, 2015 11:29
Per Post CSS for Widget Content
/*
Per Post Custom CSS
This bit of code will add a meta box to the bottom
of every post and page content editor. In that box
you can enter your CSS styling declarations and that
specific CSS style will ONLY be loaded on that individual
page or post.
*/
add_action('admin_menu', 'bb_custom_css_hooks');
add_action('save_post', 'bb_save_custom_css');
@arelthia
arelthia / show-tax-terms.php
Created April 10, 2013 03:14
//list terms in a given taxonomy [ppshowtax='' orderby='name' 'style=' ' show_count = '' pad_counts = ' ' hierarchical = ' ' hide_empty= ' ' title_li='View Lessons' title_li=''] //list terms in a given taxonomy [ppshowtax='' orderby='name' 'style=' ' show_count = '' pad_counts = ' ' hierarchical = ' ' hide_empty= ' ' title_li='View Lessons' titl…
//list terms in a given taxonomy [ppshowtax='' orderby='name' 'style=' ' show_count = '' pad_counts = ' ' hierarchical = ' ' hide_empty= ' ' title_li='View Lessons' title_li='']
function pp_show_taxs($atts){
extract( shortcode_atts( array(
'taxonomy' => 'category',
'orderby' => 'name',
'style' => 'list',
'show_count' => 0, // 1 for yes, 0 for no
'pad_counts' => 0, // 1 for yes, 0 for no
'hierarchical' => 1, // 1 for yes, 0 for no
@arelthia
arelthia / get_user_level.php
Last active December 16, 2015 00:59
Determines if the specified WLM membership level exists for the current user
/*
* determines if the specified membership level exists for the current user
* returns 0 (level does not match user) or 1 (level matched user)
*accepts string level name
*/
function pp_get_level($culevel){
//get the current user
$current_user = wp_get_current_user();
//get the users id
@arelthia
arelthia / log-notices.php
Last active December 16, 2015 00:49
Display Log Notices
*
* Display the admin notices
* Based off of ???
*/
function pt_import_notices() {
global $gpt_log;
if (!empty($gpt_log)) {