Od3n
Forum Replies Created
-
nice. would be better if use rewrite url also.
can use code provided in this thread for temporary fix.
Forum: Alpha/Beta/RC
In reply to: Remove slug from custom post type? WP 3.0Forum: Plugins
In reply to: [Plugin: Custom Post Type UI] Use same taxonomy on different post typestry add this to your registered taxonomy.
'taxonomies' => array('category','post_tag')
it will use default category and tags taxonomies.
Forum: Alpha/Beta/RC
In reply to: has_tag for custom taxonomiesok figured it out.
function has_product_tag( $product_tag, $_post = null ) { if ( !empty( $product_tag ) ) return false; if ( $_post ) $_post = get_post( $_post ); else $_post =& $GLOBALS['post']; if ( !$_post ) return false; $r = is_object_in_term( $_post->ID, 'product_tag', $product_tag ); if ( is_wp_error( $r ) ) return false; return $r; }
<?php if(has_product_tag(null)) { ?> // some code here <?php } ?>
Forum: Plugins
In reply to: [Plugin: Custom Post Type UI] Use same taxonomy on different post typesnvmnd. get it done already.
Forum: Alpha/Beta/RC
In reply to: custom posts type with custom taxonomy wp_query@c3mdigital got the work done already. see here many thanks for inspired me.
Forum: Alpha/Beta/RC
In reply to: Custom Categories and Tags Doesnt Show Upget it done already. here my code. free to use ??
@t31os_ very much thanks to you. managed to get it done with your help. really happy to share my code to whoever want to have custom categories and tags to be displayed like normal post list.
function product_columns($posts_columns) { $posts_columns = array(); $posts_columns['cb'] = '<input type="checkbox" />'; $posts_columns['title'] = _x('Title', 'column name'); $posts_columns['author'] = __('Author'); if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') ) $posts_columns['product_categories'] = __('Categories'); if ( empty($post_type) || is_object_in_taxonomy($post_type, 'post_tag') ) $posts_columns['product_tags'] = __('Tags'); $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) ) $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>'; $posts_columns['date'] = __('Date'); return $posts_columns; } function product_data_columns( $column_name) { switch ($column_name) { case 'product_categories': $_taxonomy = 'product_category'; $categories = get_the_terms( $post_id, $_taxonomy ); if ( !empty( $categories ) ) { $out = array(); foreach ( $categories as $c ) $out[] = "<a href='edit.php?product_category=$c->slug&post_type=product'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>"; echo join( ', ', $out ); } else { _e('Uncategorized'); } break; case 'product_tags': $_taxonomy = 'product_tag'; $tags = get_the_terms( $post_id, $_taxonomy ); if ( !empty( $tags ) ) { $out = array(); foreach ( $tags as $c ) $out[] = "<a href='edit.php?product_tag=$c->slug&post_type=product'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_type', 'display')) . "</a>"; echo join( ', ', $out ); } else { _e(' No Tags'); } break; } } add_filter( 'manage_product_posts_columns', 'product_columns' ); add_action( 'manage_posts_custom_column', 'product_data_columns', 10, 2 );
just like t31os_ code here, most of it i copied from template.php and make minor adjustment to reflect my custom taxonomies.
Forum: Fixing WordPress
In reply to: How to get list custom taxonomy terms for specific taxonomy@t31os_ very much thanks to you. managed to get it done with your help. really happy to share my code to whoever want to have custom categories and tags to be displayed like normal post list.
function product_columns($posts_columns) { $posts_columns = array(); $posts_columns['cb'] = '<input type="checkbox" />'; $posts_columns['title'] = _x('Title', 'column name'); $posts_columns['author'] = __('Author'); if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') ) $posts_columns['product_categories'] = __('Categories'); if ( empty($post_type) || is_object_in_taxonomy($post_type, 'post_tag') ) $posts_columns['product_tags'] = __('Tags'); $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) ) $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>'; $posts_columns['date'] = __('Date'); return $posts_columns; } function product_data_columns( $column_name) { switch ($column_name) { case 'product_categories': $_taxonomy = 'product_category'; $categories = get_the_terms( $post_id, $_taxonomy ); if ( !empty( $categories ) ) { $out = array(); foreach ( $categories as $c ) $out[] = "<a href='edit.php?product_category=$c->slug&post_type=product'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>"; echo join( ', ', $out ); } else { _e('Uncategorized'); } break; case 'product_tags': $_taxonomy = 'product_tag'; $tags = get_the_terms( $post_id, $_taxonomy ); if ( !empty( $tags ) ) { $out = array(); foreach ( $tags as $c ) $out[] = "<a href='edit.php?product_tag=$c->slug&post_type=product'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_type', 'display')) . "</a>"; echo join( ', ', $out ); } else { _e(' No Tags'); } break; } } add_filter( 'manage_product_posts_columns', 'product_columns' ); add_action( 'manage_posts_custom_column', 'product_data_columns', 10, 2 );
just like t31os_ code, most of it i copied from template.php and make minor adjustment to reflect my custom taxonomies.
Forum: Alpha/Beta/RC
In reply to: custom posts type with custom taxonomy wp_queryok thanks. will try and update later.
Forum: Alpha/Beta/RC
In reply to: What are hierarchical post typespages & categories are hierarchical.
posts & tags are not hierarchical.means pages & categories can have parent, butposts & tags cant. UI will depends on the hierarchical.
Forum: Alpha/Beta/RC
In reply to: Custom post type (index) and popup commentmay be you could share some code here.
Forum: Fixing WordPress
In reply to: How to get list custom taxonomy terms for specific taxonomyhow about to use custom categories and/or post tags ?
Forum: Fixing WordPress
In reply to: problems with is_post_type() – perhaps it is a bug?here the code i use.
<?php if(is_singular('product')) { ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(Products) ) : ?> <?php endif; ?> <?php } else { ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> <?php endif; ?> <?php } ?>
before this i use
is_single() && is_post_type($post_type)
but they doesnt seems to work.Forum: Fixing WordPress
In reply to: How to get list custom taxonomy terms for specific taxonomyi mean on your books list or edit page. admin menu just work fine.
i want to display categories and tags like this :
https://dl.dropbox.com/u/2317543/Screen%20shot%202010-06-08%20at%203.03.56%20AM.png
they are missing here :
https://dl.dropbox.com/u/2317543/Screen%20shot%202010-06-07%20at%202.54.14%20PM.png