Blog

Redirect your visitors to a THANK YOU page after using the ClassiPress sidebar contact form

Tested on WordPress 4.2  &  ClassiPress Version: 3.4

When using the default ClassiPress sidebar contact form in the single ad listing, all you get after sending the request to the ad owner is an odd “Your message has been sent! message with no further action. It happens that some people don’t even see that message and don’t know if the email was sent.

In this tutorial i’ll explain you how to redirect the sender to a “Success” page after he clicked on the “submit” button. For this purpose we will create our own  “Success” page. That “Success” page will give you additional possibilities to give your customers a choice what to do next. Let him post an ad right away, or send him back to the ad he was watching, or maybe place some banner adverts? Here you can get creative. If your customer absolutely doesn’t know what to do, he will be automatically redirected to the home page after 30 seconds.

Check this screenshot and get the idea:

contact-message

Would you like to test this function? Please try it out on my demo site:

Demo Site

I assume that you have ClassiPress and your own child theme running. Time to get started:

Step 1.

The files we need to customize are:

  • /child-theme/functions.php
  • /child-theme/includes/sidebar-contact.php

We will also create a completely new file and call it:

  • /child-theme/success.php

As we don’t like to change ClassiPress core files, we now take a copy of those files that we need to change and add them to our child-theme folder. For the sidebar-contact.php you must  create a /includes folder in your child theme directory and upload that file into that new folder. The result will look like this: /child-theme/includes/sidebar-contact.php

Done? Let’s start to edit our copied files.

please-read

Dear visitor. Redirect your visitors to a THANK YOU page after using the ClassiPress sidebar contact form is a premium article. If you would like to get access to the rest of this article, please pay $ 3.45 USD fee to help me keeping this site alive. After your payment is done you will automatically receive an Email that includes an activation link. Please Note: The activation link is valid for 2 days.

Tags: , , , , , ,

25 Responses to “Redirect your visitors to a THANK YOU page after using the ClassiPress sidebar contact form”

  1. Robert August 30, 2013 at 19:28 #

    Do you want a teaching position? For theme design? You could. Your “lesson” is completely understood and well formatted. You could always package all these nifty lessons with theme files and sell them in the market place or your own site, if you will. Maybe write a book for Amazon Store. Nothing is out of reach for you Rolf! I’ll use the “lesson” in my current build soon enough. I just have to think of what to place on the “next” page. Besides the obvious affiliate banner offers and newsletter sign up form.

  2. Michaël-Joseph Forand August 31, 2013 at 09:43 #

    Is this tutorial workable with 3.3?

  3. Mira August 31, 2013 at 10:58 #

    This post doesnt work for me. By entering step 1 code I got error message and 500 error. Tried it in two sites and a third time.

    • Rolf Hassel August 31, 2013 at 11:17 #

      Then you are doing something wrong. Which ClassiPress version are you using? This tutorial requires a child theme, are you using one? Maybe you did some other modifications that get in conflict with this one. Maybe i can see something when you post the URL to your sites.

      Cheers

  4. John August 31, 2013 at 14:02 #

    I tried on 3.3.1 version but I get this error
    “ERROR: The reCaptcha anti-spam response was incorrect.”
    I tried several times.

  5. John August 31, 2013 at 14:46 #

    Looks like you have reCaptcha set on your sidebar form … I have just a question like 2+5=
    The default CP sidebar.

  6. Michaël-Joseph Forand September 1, 2013 at 20:47 #

    Rolf, can you add a bit of text for the redirect if a MU installation is used? I’ve tested it out on my dev site and it works minus the redirect.

  7. Steve September 7, 2013 at 17:51 #

    Hi Rolf, I love this idea. I followed the tutorial step by step, and received a “page not found” error after the gif stopped processing. You can view this error if you go to the website and send an inquiry message on any of the sale items. P.S. Most of the content is posted by Admin for now so your message will come to me.

    Thanks

    Steve

    • Rolf Hassel September 7, 2013 at 18:28 #

      Hi Steve,

      It’s because you haven’t created the thank-you page. http://www.elpuenteazul.com/thank-you/
      If yiu have a thank-you page in your language, you need to replace the page name in the above code.

      Cheers

      • Steve September 8, 2013 at 16:48 #

        That was the fix! Thank you!

        I had emailed you a few days ago with a question about how to get my blog page to display summaries of each blog, instead of the entire text. Any suggestions?

        Thanks!

  8. Leosch September 8, 2013 at 10:36 #

    Hi Rolf,

    like always a great contribution. I even use this page for sponsoring, I sell ads on the page. Only thing which I would like to add, is that you can’t call this page in your browser without sending a message to the ad owner.

  9. Mark September 9, 2013 at 07:48 #

    Can you write an article on how to make a “Report an ad” button so that registered users can report inappropriate ads.

  10. Mark September 9, 2013 at 07:57 #

    Hi,

    How difficult would it be to use this in the Ad posting process, between step 2 and into step 3?. Because my site posts to many facebook groups the posting process can take a while. This as a result gives users the impression the site is doing nothing or has crashed etc and they keep pressing the continue button.

  11. manamaga September 24, 2013 at 21:12 #

    When I tried this and visited my website, I got ‘server error’ message. I have have the latest version of CP and WP. Is this only for earlier versions? Many thanks.

    • Rolf Hassel September 25, 2013 at 07:38 #

      Hi Manamaga,
      This is tested on the latest WordPress & ClassiPress version. Please check if you have done it exactly as described.

      Cheers

  12. manamaga September 25, 2013 at 15:06 #

    My bad, pasted the code incorrectly. All working fine. I’ve added a google ad to the page too 😀

    Another great tut. Many thanks!

  13. pollachi October 18, 2013 at 09:49 #

    im my sidebar contact form,
    clear the text field once submitted the form.

    how to do it?
    kindly reply us

  14. Pascal November 14, 2013 at 01:08 #

    Hi,

    my redicrect have create a loop and he dosen’t work.

    What I have to do for redirecting my custumer to homepage?

    Thanks,
    Pascal

  15. Pascal November 14, 2013 at 01:13 #

    Now when I try to send a message via the contact bar of the ad, the site keeps telling me: “ERROR: the answer to reCaptcha was wrong.”

    How can I fix?

    thanks

  16. Arman October 4, 2014 at 05:22 #

    Hi, I have the reCaptcha issue. how i can solve it?

    • Rolf Hassel October 4, 2014 at 07:21 #

      I already answered your email about this. Please check

  17. talao October 21, 2014 at 20:37 #

    i paid but i didnt receive any email….
    please check your paypal panel…….

    • Rolf Hassel October 21, 2014 at 20:48 #

      The link was automatically and immediately sent to the email that you have transmitted. But looking at that email, i’m quit sure that you have set a fake address. Please contact me for further details

Leave a Reply


+ 4 = 9

Go Up ▲Go Up ▲