Answer the question
In order to leave comments, you need to log in
How to display posts by tag_id in wordpress?
Friends, I installed the
Custom Post Type UI plugin, created a separate post type and taxonomy
I started posts there and the taxonomy is tagged. tag_id
it's time to display them via wp_query
$count = $titan->getOption( 'set-team-count' );
$query = new WP_Query( array('post_type' => 'fitnes_programs', 'tag_id' => '38', 'showposts' => $count ) );
while ( $query->have_posts() ) : $query->the_post(); ?>
тело цикла
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
Answer the question
In order to leave comments, you need to log in
As one of the options - Mask:
1) Prepare a white wave in Photoshop
2) Use a double background under the test background, for example:
background: url("image/pic-mask.png") no-repeat bottom, #000 top;
background-size: 100% auto, auto;
Do one repetition of the wave (bitmap) bet on background
, point background-repeat: repeat-x
to , then play around with different proportions background-size
. Specifically, set the desired height in pixels, and the width as a percentage is possible.
1. Custom Post Type UI - infernal evil, all the points below stem from its thoughtless use, which does not imply knowledge of how it works under the hood.
2. 'showposts' - obsolete parameter, use posts_per_page instead
3. 'tag_id' - applies only to the standard tag taxonomy - post_tag
4. In your case, you need to operate with the 'tax_query' parameter
$query = new WP_Query( [
'post_type' => 'fitnes_programs',
'posts_per_page' => (int)$count,
'tax_query' => [
[
'taxonomy' => 'fitnes_program',
'field' => 'id',
'terms' => [38]
]
]
] );
For example, here is one of the sections with ID 39 , similar to what I presented above in the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question