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
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 ) { |
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
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) { |
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
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'] ) { |
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
default: | |
do_action( 'ntg_render_' . $field['type'] , $field, $meta , $this->get_field_name( $field['id'] ) ); |
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
$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 ) . '">'; |
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
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'] ) ); | |
} |
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
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; |
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
// 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'; | |
} |
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
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 ) { |
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
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