We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
首先摸一下你的自定义的类型,显示这样的连接
http://localhost/wp-admin/term.php?taxonomy=category&tag_ID=10&post_type=post&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dcategory
下面的参数即使对应的
&post_type = post& , taxonomy = category&, &tag_ID=10&
<?php $args = array( 'post_type' => 'post', //自定义文章类型名称,上面连接可以获得。 'showposts' => 3 , //输出的文章数量,这个可以是缺省值,不用设置 'tax_query' => array( array( 'taxonomy' => '1',//自定义分类的名称 'terms' => 10 // 上面显示的id ), ) ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post();?> <h3><?php the_title(); ?></h3> <p><?php the_content(); ?></p> <?php endwhile; wp_reset_query(); //重置query查询 } ?>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
首先摸一下你的自定义的类型,显示这样的连接
下面的参数即使对应的
The text was updated successfully, but these errors were encountered: