View gist:1647598
case 'taxonomy_select': | |
echo '<select name="', $field['id'], '" id="', $field['id'], '">'; | |
$names= wp_get_object_terms( $post->ID, $field['taxonomy'] ); | |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' ); | |
if ( $field['options'] ) { | |
foreach ($field['options'] as $option) { | |
echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>'; | |
} | |
} | |
foreach ( $terms as $term ) { |
View gist:1690040
add_action( 'ntg_render_post_type_select' , 'wps_post_type_select' , 10 , 3 ); | |
function wps_post_type_select ( $field, $meta, $id ) { | |
global $post; | |
if ( $field['type'] == 'post_type_select' ) { | |
echo '<select name="', $id, '" id="', $id, '">'; | |
$pts = get_post_types(); | |
if ( $field['options'] ) { | |
foreach ($field['options'] as $option) { |
View gist:1690166
add_action( 'ntg_render_taxonomy_terms_select' , 'wps_taxonomy_terms_select' , 10 , 3 ); | |
function wps_taxonomy_terms_select ( $field, $meta, $id ) { | |
global $post; | |
if ( $field['type'] == 'taxonomy_terms_select' ) { | |
echo '<select name="', $id, '" id="', $id, '" style="margin-top: 5px;">'; | |
$pts = get_post_types(); | |
echo '<option style="padding-right:10px;" value=""', selected ( $meta, '' ), '>', __( 'All Taxonomies and Terms', WPS_SLIDER ).'</option>'; | |
if ( $field['options'] ) { |
View gist:1690169
default: | |
do_action( 'ntg_render_' . $field['type'] , $field, $meta , $this->get_field_name( $field['id'] ) ); |
View nothing.php
$post_classes = get_post_class(); | |
$odd_or_even = 'even'; | |
$post_counter = 0; | |
$post_counter++; | |
$odd_or_even = ( 'odd' == $odd_or_even ) ? 'even' : 'odd'; | |
$post_classes[] = ( $post_counter == count( $posts ) ) ? 'last-post' :$odd_or_even; | |
echo '<div class="' . implode( ' ', $post_classes ) . '">'; |
View radio-latest-news-widget.php
if ( ! empty( $instance['show_content'] ) ) { | |
if ( 'excerpt' == $instance['show_content'] ) | |
the_excerpt(); | |
elseif ( 'content-limit' == $instance['show_content'] && strip_shortcodes( get_the_content() ) != '' ) | |
the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) ); | |
else | |
the_content( esc_html( $instance['more_text'] ) ); | |
} |
View gist:1926880
function genesis_get_custom_field($field, $single = true) { | |
global $id, $post; | |
if ( null === $id && null === $post ) { | |
return false; | |
} | |
$post_id = null === $id ? $post->ID : $id; |
View genesis-favicon.php
// Loads favicon from specified URL | |
add_filter( 'genesis_pre_load_favicon', 'wps_custom_favicon_filter' ); | |
function wps_custom_favicon_filter( $favicon_url ) { | |
return 'http://domain.com/path/mycustomfavicon.ico'; | |
} |
View embed-objects.php
add_filter( 'embed_defaults', 'wps_embed_defaults' ); | |
/** | |
* Changes the default embed sizes based on site layout | |
* @author Travis Smith | |
* | |
* @param array height and width keys, values can be string/int | |
* @return array height and width keys and values | |
*/ | |
function wps_embed_defaults( $defaults ) { |
View genesis-embed-objects.php
add_filter( 'embed_defaults', 'wps_embed_defaults' ); | |
/** | |
* Changes the default embed sizes based on site layout | |
* via filtering wp_embed_defaults() | |
* | |
* @author Travis Smith | |
* | |
* @param array height and width keys, values can be string/int | |
* @return array height and width keys and values | |
*/ |
OlderNewer