how to save custom post tile in contact form 7 [on hold]

i am creating cars website and looping custom post types of ‘cars’ to get all cars, all cars contains ‘book now’ button and when the user clicks on it, a model dropdown appears containing contact form 7. i want the post title of the post whose ‘book now’ button is clicked to be saved in contact form7 and also sent as email. how can i do that?
this is my current code:

$query = new WP_Query($thequery);

if($query -> have_posts()){
//$string .= ‘<div>’;
while($query->have_posts()) : $query->the_post();
get_the_title();
get_the_excerpt();
//book now button here****

//html for modal dropdown*****
do_shortcode( ‘[contact-form-7 id=”33″ title=”Book Now”]’ )
endwhile;

i don’t know why i can’t right html here, so i am sharing only php code so that you can have idea what i am doing.
this loop prints all post types of which the query runs and show them in the form of boxes containing title, description and book now button.

Read more here:: how to save custom post tile in contact form 7 [on hold]

Leave a Reply

Your email address will not be published. Required fields are marked *