$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'audio', 'paged' => $paged, 'posts_per_page' => 15, 'tax_query' => array( array( 'taxonomy' => 'audio_category', 'terms' => array($cat), 'field' => 'id', ) ), 'meta_query' => array( array( 'key' => 'singername', 'value' => $archivesinger, 'compare' => 'LIKE' ), array( 'key' => 'albumn', 'value' => $archivealbum, 'compare' => 'LIKE' ), ), );
Thursday, July 25, 2013
custom post type with category query
Wednesday, July 24, 2013
How To Create Custom Taxonomies Fields In WordPress
<?php
add_action('category_add_form_fields','extra_category_fields');
add_action ( 'edit_category_form_fields', 'extra_category_fields');
//add extra fields to category edit form callback function
function extra_category_fields( $tag ) { $t_id = $tag->term_id;
$cat_meta = get_option( "category_$t_id");
?><tr class="form-field">
<th scope="row" valign="top"><label for="extra1"><?php _e('Category Sidebar'); ?></label></th>
<td>
<select name="Cat_meta[sidebarpage]" id="Cat_meta[sidebarpage]">
<option value=""> </option>
<option value="organization" <?php if($cat_meta['sidebarpage']=="organization") echo "selected";?>>Organization Menu </option>
<option value="culturalbuilding" <?php if($cat_meta['sidebarpage']=="culturalbuilding") echo "selected";?>>Cultural building Menu</option>
</select>
<br />
<?php //echo $cat_meta['sidebarpage'];?>
<span class="description"><?php _e('Category Sidebar design'); ?></span>
</td>
</tr>
<?php
}
add_action('create_category','save_extra_category_fileds');
add_action ( 'edited_category', 'save_extra_category_fileds');
// save extra category extra fields callback function
function save_extra_category_fileds( $term_id ) {
if ( isset( $_POST['Cat_meta'] ) ) {
$t_id = $term_id;
$cat_meta = get_option( "category_$t_id");
$cat_keys = array_keys($_POST['Cat_meta']);
foreach ($cat_keys as $key){
if (isset($_POST['Cat_meta'][$key])){
$cat_meta[$key] = $_POST['Cat_meta'][$key];
}
}
//save the option array
update_option( "category_$t_id", $cat_meta );
}
}
Monday, July 15, 2013
Add Pop-up Windows to Your WordPress
add_action('init', 'init_theme_method'); function init_theme_method() { add_thickbox(); }
<div style="text-align:center;padding:20px;"><input alt="#TB_inline?height=300&width=400&inlineId=examplePopup1" title="add a caption to title attribute / or leave blank" class="thickbox" type="button" value="Show Thickbox Example Pop-up 1" /></div>
<div id="examplePopup1" style="display:none"><h2>Example Pop-up Window 1</h2><div style="float:left;padding:10px;"><img src="http://shibashake.com/wordpress-theme/wp-content/uploads/2010/03/bio1.jpg" width="150" height = "168"/>I was born at DAZ Studio. They created me with utmost care and that is why I am the hottie that you see today. My interests include posing, trying out cute outfits, and more posing.</div>