Lượt xem | |
Hiện tại: | |
1h trước: | |
24h trước: | |
Tổng số: |
Hôm nay tôi sẽ chia sẽ với anh/chị bài viết “Các function liên quan đến term trong wordpress”. Chúng ta trong quá trình làm theme thì sẽ gặp vấn đề như tôi nói dưới đây:
'name', 'order' => 'ASC', 'hide_empty' => false, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 'hierarchical' => true, 'child_of' => 0, 'childless' => false, 'get' => '', 'name__like' => '', 'description__like' => '', 'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core' ); $categories = get_terms( "category", $args );
slug; $name = $term->name; $desc = $term->description; ?>
name; ?> ?>
'; foreach ( $termchildren as $child ) { $term = get_term_by( 'id', $child, $taxonomy_name ); echo '
//returns: Array ( [0] => 23 [1] => 6 ) //Child Page (448) //returns: Array ( [0] => 447 )
ID, 'on-draught' ); if ( $terms && ! is_wp_error( $terms ) ) : $draught_links = array(); foreach ( $terms as $term ) { $draught_links[] = $term->name; } $on_draught = join( ", ", $draught_links ); ?>On draught:
2015-06-28 01:39:04
Nguồn: http://fcwordpress.net/cac-function-lien-quan-den-term-trong-wordpress.html