我在 wordpress 中使用以下代码,并且还使用了灯箱表单插件。
<?php query_posts('showposts=9&post_type=packages') ?>
<?php while (have_posts()) :the_post(); ?>
<?php echo the_post_thumbnail(); ?>
...
...
<span class="package-book">
<div id="text"><?php the_title(); ?></div>
<script type="text/javascript">
var $ = jQuery.noConflict();
$(document).ready(function() {
$(".package-book a").click(function() {
var $temp = $('#text').html();
$('#book-title').val($temp);
});
});
</script>
<?php echo do_shortcode("[formlightbox text='Book Now' title= 'welcome'][contact-form-7 id='383' title='Booking Form'][/formlightbox]"); ?>
or consider this <a title="welcome" class="fl_box-1" href="#">Book Now</a>
</span>
<?php endwhile; ?>
<input type="text" size="40" class="wpcf7-form-control wpcf7-text" id="book-title" value="" name="PackageTitle">
I am using contact us 7 plugin
并创建了一个嵌入到灯箱表单中的表单预订表单。
其实when book now anchor tag is clicked
现在的书form gets popped up on the screen.
I want that input type text with id book-title
应该filled with current package title<?php the_title(); ?>.
The above jquery works for first package only.
请帮助我,以便它适用于所有软件包。