This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// you can do this in your functions.php file, a plugin file | |
// or even in your theme before comments are displayed: | |
add_filter( 'comments_array', 'array_reverse' ); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready(function($){ | |
//Email Encrypt | |
$(".email").each(function(){ | |
var ats, dots, address, i; | |
ats = [ ' at ', ' (at) ', ' [at] ' ]; | |
dots = [ ' dot ', ' (dot) ', ' [dot] ' ]; | |
address = $(this).html(); | |
for ( i = 0; i < ats.length; i++ ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^blog.domain.com | |
RewriteRule ^(.*)$ http://www.domain.com/blog/$1 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Sizeable Body Classer | |
Author: theandystratton | |
Author URI: http://sizeableinteractive.com | |
Description: Add to your functions.php to have quick functions for adding body classes. Simply run the following code before get_header(): szbl_add_body_class( 'some-body-class' ); | |
Version: 0.1 | |
License: GPL2 | |
*/ | |
function szbl_add_body_class( $class, $return = false ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'enter_title_here', 'szbl_enter_title_here' ); | |
function szbl_enter_title_here( $title ) | |
{ | |
switch ( get_post_type() ) | |
{ | |
case 'szbl-location': | |
$title = 'Enter Location Name'; | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Add the actual columns to the szbl-location edit listing admin screen. | |
*/ | |
add_filter( 'manage_edit-szbl-location_columns', 'szbl_manage_edit_columns', 10 ); | |
function szbl_manage_edit_columns( $cols ) | |
{ | |
$new_cols = array( | |
'cb' => '<input type="checkbox">', | |
'title' => __( 'Location Name' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'szbl_register_tax' ); | |
function szbl_register_tax() | |
{ | |
register_taxonomy( | |
'szbl-location-category', | |
array( 'szbl-location' ), | |
array( | |
'labels' => array( | |
'name' => __( 'Store Categories' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Grab the top 5 locations with content tagged as "Featured" | |
and "Child Care" then output them in an ordered list. | |
*/ | |
$locations = get_posts(array( | |
'post_type' => 'szbl-location', | |
'posts_per_page' => 5, | |
'orderby' => 'menu_order', | |
'order' => 'asc', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Add custom icon with grayscale to color activation states. | |
Makes you more like core. | |
We're assuming this is included in your core plugin file | |
and the icon cpt-icon.png is in the same directory. | |
So, if this file were /wp-content/plugins/my-plugin/plugin.php |