我有两个模态,一个在另一个模式中.第一个模态包含一个表单,在提交时我想要另一个模态,其中有一个消息要打开.我用Bootstrap做了这个.单击此按钮时,将打开第一个模态:
<button class="contact-button" data-toggle="modal" data-target="#contact-modal">Contacteaz?-ne</button>
Run Code Online (Sandbox Code Playgroud)
这是第一个模式:
<div id="contact-modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Contacta?i-ne</h4>
</div>
<div class="modal-body">
<form id="contact-form">
<div class="col-md-12">
<h4>Numele Dvs *</h4>
<input type="text" name="name" value="" placeholder="">
</div>
<div class="col-md-6">
<h4>Email *</h4>
<input type="text" name="email" value="" placeholder="johndoe@yahoo.com">
</div>
<div class="col-md-6">
<h4>Telefon *</h4>
<input type="text" name="tel" value="" placeholder="+40******">
</div>
<div class="col-md-12">
<h4>Mesaj *</h4>
<textarea></textarea>
</div>
<div class="col-md-12"><h6>*câmpurile sunt obligatorii</h6></div>
<div class="col-md-12 call">
<button>Trimite Mesaj</button>
</div>
</form>
</div>
</div>
</div>
</div> …Run Code Online (Sandbox Code Playgroud) 有很多与我相关的主题,但我仍然没有找到解决方案。我正在尝试通过 ACF 字段(单选按钮)查询帖子,似乎 meta_query 被完全忽略。它返回所有帖子,而不是仅返回符合条件的帖子。我尝试过使用字段键而不是字段名称、其他比较等。似乎没有任何效果。希望您知道可能出了什么问题!这是我的代码:
<?php
$post_args = array(
'post_type' => 'products',
'posts_per_page' => - 1,
'status' => 'publish',
'meta_query' => array(
'relation' => 'AND',
array(
'meta_key' => 'product_taste',
'meta_value' => array( 'cold' ),
'compare' => 'IN',
),
array(
'meta_key' => 'product_served',
'meta_value' => array( 'grated' ),
'compare' => 'IN'
)
),
);
$query = new WP_Query( $post_args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) : ?>
<?php
$query->the_post();
?>
<h5>
<?php the_title(); ?>
</h5>
<?php endwhile …Run Code Online (Sandbox Code Playgroud)