This file contains 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 | |
/* | |
* File: insertPersonData.php | |
* By: TMIT | |
* Date: 20100601 | |
* | |
* This script sets up an ARRAY for tPerson field names | |
* and an ARRAY for 3 tPerson ROWs of data | |
* |
This file contains 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 | |
/* | |
Custom field search widget | |
This code adds a widget that allows to search for milepost ranges | |
*/ | |
// use widgets_init action hook to execute custom function | |
add_action( 'widgets_init', 'wpyr_milepostwidget_register_widgets' ); |
This file contains 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
// guess current plugin directory URL | |
$plugin_url = plugin_dir_url(__FILE__); | |
//enqueue script | |
wp_enqueue_script('wpc_script', $plugin_url . 'js/script.js'); |
This file contains 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
class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{ | |
var $to_depth = -1; | |
function start_lvl(&$output, $depth){ | |
$output .= '</option>'; | |
} | |
function end_lvl(&$output, $depth){ | |
$indent = str_repeat("\t", $depth); // don't output children closing tag | |
} |
This file contains 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
// behold the magic of regular expressions | |
// goes with http://www.cssplay.co.uk/menu/css3-photo-curl.html | |
function chiro_filter_images($content){ | |
return preg_replace('/<img (.*) \/>\s*/iU', '<b class="curl"><b><img \1 /></b></b>', $content); | |
} | |
add_filter('the_content', 'chiro_filter_images'); |
This file contains 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 | |
// Create array for posts, we will stick the attachment post_parent in here | |
$posts = array(); | |
// Get all images attached to post that have "Include in Rotator" marked as "Yes" | |
$args = array( | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'post_status' => 'inherit', | |
'posts_per_page' => '-1', |
This file contains 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
// courtesy http://wpsnipp.com/index.php/posts/display-taxonomy-terms-in-an-unordered-list/ | |
$terms = get_the_term_list( $post->ID, 'TAXONOMY_NAME',',',',',''); | |
$terms = explode(',',$terms); | |
echo '<ul>'; | |
for($i = 0;$i<sizeof($terms);$i++){ ?> | |
<li><? echo $terms[$i]; ?></li> | |
<? } | |
echo '</ul>'; |
This file contains 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
case 'taxonomy_select': | |
$names= wp_get_object_terms( $post->ID, $field['taxonomy'] ); | |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' ); | |
$selected = ''; | |
foreach ( $terms as $term ) { | |
if (!is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) { | |
$selected = $term->slug; | |
} else { | |
} |
This file contains 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 | |
/** | |
* The glossary archive template | |
*/ | |
/** | |
* Remove the standard loop | |
*/ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); |
This file contains 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
//courtesy http://www.binaryturf.com/genesis-tip-remove-post-info-specific-custom-post-type/ | |
add_filter('genesis_post_info', 'aha_post_info'); | |
add_filter('genesis_post_meta', 'aha_post_meta'); | |
function aha_post_info($post_info) | |
{ | |
global $post; | |
if(get_post_type($post->ID) == 'ai1ec_event' ) | |
{ | |
return false; |
OlderNewer