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 | |
/** | |
* WordPress function to fix pagination when combining custom post types in a single loop. | |
*/ | |
function fix_allcustomposts_pagination($qs) | |
{ | |
if( !isset( $qs['post_type'] ) && isset($qs['paged']) ) | |
{ | |
$qs['post_type'] = get_post_types($args = array( | |
'public' => true, |
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 | |
// Set-up the loop with all custom post types | |
$post_types = array( 'post', 'link', 'snippet', 'doodle' ); | |
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
$args = array( | |
'post_type' => $post_types, | |
'paged' => $paged, | |
'posts_per_page' => 10 | |
); | |
query_posts( $args ); |
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
#!/bin/bash | |
HOST=`cat /etc/hostname` | |
SUBJECT="Test Email from $HOST" | |
TO="[email protected]" | |
MSG="/tmp/mail-test.msg" | |
echo "This is a test email message from $HOST." > $MSG | |
echo "Please do not respond to this message." >> $MSG | |
mail -s "$SUBJECT" "$TO" < $MSG | |
exit |
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 | |
function global_is_user_logged_in() | |
{ | |
global $iewp_crunchstats_logged_in; | |
$is_user_logged_in = false; | |
if ( is_user_logged_in() == true ) | |
{ | |
$is_user_logged_in = true; | |
} | |
} |
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 | |
// Remove buttons from TinyMCE to make a simpler interface | |
function simpler_tinymce_buttons( $buttons ) | |
{ | |
$remove = array( | |
'aligncenter', | |
'alignright', | |
'alignleft', | |
'hr', | |
'wp_more', |
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 | |
if ( ! defined( 'WPINC' ) ) { die('Direct access prohibited!'); } | |
/** | |
* Conditionally include additional CSS and JS for page templates | |
*/ | |
function conditionally_enqueue_scripts() | |
{ | |
// Test for page template | |
if( is_page_template() ) | |
{ |
OlderNewer