Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

Would be very nice if someone could help me.

Thanks, Oli

share|improve this question

closed as off-topic by birgire, kaiser Jul 28 at 14:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

up vote 0 down vote accepted

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>
share|improve this answer
    
Hey, thanks for helping! :) With get_page_link(58) have to now the Id of the actual page. Is this right? The Problem here is that my posts are dynamic. So I can't now the ID of the post. –  oBear Nov 23 '11 at 8:38

Ok, i got it now! Like GavinR recommended I'm using now the Contact Form 7 Dynamic Text Extension

A very nice tutorial how to work with the plugin can be found here.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.