我已经制作了视觉作曲者插件来满足其中一项要求。但是,我发现它始终位于其他vc元素之上。
我尝试根据vc composer其他元素添加类
public function sim_product($attr)
{
?>
<div class="vc_column-inner"><div class="wpb_wrapper">
<div class="wpb_text_column wpb_content_element ">
<div class="wpb_wrapper">
<div class="more-project-list">
<?php
$select = $attr['sim_product_id'];
$query = new WP_Query( array( 'post_type' => 'products','post__in' => explode(",",$select) ));
if ( $query->have_posts() ) { ?>
<?php while ( $query->have_posts() )
{ $query->the_post(); ?>
<div class="single-blk" style='background-color: <?php echo the_field('colour');?>'>
<div class="title">
<a href="<?php the_permalink();?>"><?php the_title();?></a>
</div>
<figure>
<?php if (has_post_thumbnail( $query->ID ) )
{
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $query->ID ), 'single-post-thumbnail' ); ?>
<img src="<?php echo $image[0]; ?>" alt="">
<?php }?>
</figure>
<div class="category">
<?php
$terms = wp_get_post_terms( $query->post->ID, array( 'Product_category') );
foreach ( $terms as $term ) { echo $term->name;}
?>
</div>
</div>
<?php }}?>
</div>
</div></div></div></div>
<?php
}
它不会出现在我放置它的地方,它总是放在最前面