Add the last viewed post title to a contactform with shortcode

I’m using the contactform 7 plugin and i want to add the title of the last viewed page (The page visited before the contact) to the dynamic field of the plugin with a shortcode. Is there a way to do that?

I found this plugin Last Viewed Posts to display the last visited post. But I can’t found a solution to add this to the dynamic field of my contactform.

Read More

Would be very nice if someone could help me.

Thanks, Oli

Related posts

Leave a Reply

2 comments

  1. I think the best way to do this would be to use the Contact Form 7 Dynamic Text Extension, and then pre-populate the URL to the Contact Form page with the current post title. More details on how to do that in my answer here. The code to pre-populate the link in a post template would look something like:

    <a href="<?php echo get_page_link(58); ?>&foo=<?php single_post_title(); ?>">Contact Form</a>