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
// Set up a custom query | |
$featured_query = new WP_query(); | |
// Your query args | |
$featured_args=array( | |
'post_type'=>'post', | |
'meta_key'=>'featured_product', | |
'meta_value'=>'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
jQuery(function(jQuery) { | |
jQuery('#media-items').bind('DOMNodeInserted',function(){ | |
jQuery('input[value="Insert into Post"]').each(function(){ | |
jQuery(this).attr('value','Use This Image'); | |
}); | |
}); | |
jQuery('.custom_upload_image_button').click(function() { |
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
<? | |
/** | |
* Reusable Custom Meta Boxes by Tammy Hart | |
* | |
* | |
*/ | |
// Add the Meta Box | |
function add_custom_meta_box() { | |
add_meta_box( | |
'custom_meta_box', // $id |
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
function taxonomy_filter_restrict_manage_posts() { | |
global $typenow; | |
// If you only want this to work for your specific post type, | |
// check for that $type here and then return. | |
// This function, if unmodified, will add the dropdown for each | |
// post type / taxonomy combination. | |
$post_types = get_post_types( array( '_builtin' => false ) ); |
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
add_filter("manage_edit-artist_columns", "artist_edit_columns"); | |
function artist_edit_columns($columns) { | |
$columns = array( | |
'cb' => '<input type="checkbox"/>', | |
'thumbnail' => __('Image'), | |
'title' => __('Artist'), | |
'performance' => __('Type'), | |
'slides_home' => __('on Homepage'), | |
); |
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
add_action("manage_posts_custom_column", "artist_custom_columns"); | |
function artist_custom_columns($column) { | |
global $post; | |
switch ($column) { | |
case "performance": | |
$_taxonomy = 'artist_performance'; | |
$terms = get_the_terms( $post_id, $_taxonomy ); | |
if ( !empty( $terms ) ) { |
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
function set_artist_post_types_admin_order($wp_query) { | |
if (is_admin()) { | |
// Get the post type from the query | |
$post_type = $wp_query->query['post_type']; | |
if ( $post_type == 'artist') { | |
// check if parameter is not set yet |
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
if ( function_exists( 'add_image_size' ) ) { | |
add_image_size( 'unlimited-width-thumb', 9999, 200 ); // unlimited width, 200 pixels height | |
add_image_size( 'cropped-thumb', 200, 100, true ); // (cropped) | |
} |
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
add_filter('cpac_use_hidden_custom_fields', '__return_true'); /* enables the use hidden custom fields */ |
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
/** | |
* jpeg_quality_callback | |
* | |
* set thumbnail quality to 100% | |
*/ | |
function jpeg_quality_callback($arg) { | |
return (int)100; | |
} |
NewerOlder