• Resolved newshop

    (@newshop)


    Hello,
    I want to use a contact form that I created with Contact Form 7 plugin into a popup. In this contact form, I’ve added [_post_url] into the message body. This will add the post url of which the form was sent into the email that I receive. If I use the contact form without the popup, all works finde but if I use the contact form within the popup, the email that I receive doesnt contain the url, but only “[_post_url]”. Any idea how to fix this?
    Many thanks in advance and best wishes!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @newshop

    Sorry you’re having difficulties, I’m sure we can this resolved.

    I’ll have our Lead Dev @danieliser take a look as soon as possible. Thank you for being patient.

    Plugin Author Daniel Iser

    (@danieliser)

    @newshop It has to do with how they [_post_url] is replaced. Unfortunately they do it based on get_the_permalink(), but that won’t always return the value expected. For instance calling that inside the loop in a recent posts widget will give a different value for each post in the list.

    In this case it returns nothing since popups don’t have a url. They likely need to update [_post_url] to use the main query only global $wp_query; get_the_permalink( $wp_query->post->ID );

    Not sure what we can do from our end. In order for a lot of our filters to work properly we have to use a WP loop which may cause issues like this.

    Hope that helps.

    Thread Starter newshop

    (@newshop)

    Hello,
    thank you very much for your detailed answer. I have now found a solution by using the Contact Form 7 Dynamic Text Extension. 🙂

    @newshop

    Excellent! Let us know if you have any other questions or issues, and we’ll be happy to assist you.

    If you’re enjoying our product, please do take a moment to click that our plugin Works and to rate and review the plugin to spread the love! <3

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Contact form 7 and [_post_url]’ is closed to new replies.