Title: How to include a referer ?
Last modified: January 18, 2019

---

# How to include a referer ?

 *  Resolved [root09](https://wordpress.org/support/users/root09/)
 * (@root09)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/)
 * How to include a referer ?
    i have a page with Woocomerce AND happyforms both
   working nice together. look at… [Woocomerce and happyform](https://prnt.sc/m93l9l)
 * i would like to know the page origin…?
    displayed like this: **[https://website.fr/produit/flying-ninja](https://website.fr/produit/flying-ninja)**
 * thank you 🙂

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

 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11107159)
 * Hey there, [@root09](https://wordpress.org/support/users/root09/)!
 * HappyForms doesn’t include a visual control for that, we’re sorry! Luckily, it’s
   quite easy to do with a bit of PHP and HappyForms hooks.
 * If you’re up for the challenge, let us know! We’ll be glad to share a simple 
   step by step example.
 *  Thread Starter [root09](https://wordpress.org/support/users/root09/)
 * (@root09)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11111303)
 * Hey [@thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
   
   ok for the chalenge …
 * BUT…to be honest with you, it will be “difficult”
    for me…
 * thanks for you patience…
    🙂
 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11115691)
 * Got it, [@root09](https://wordpress.org/support/users/root09/)!
 * It’s luckily quite simple. Try these steps:
 * 1. Add a **Short Text** part to your form. Doesn’t matter where – we’ll eventually
   hide it with CSS.
    2. In your part configuration widget, click the **Advanced**
   link. 3. Set your **Custom CSS class** option to `happyforms-part-page-id`. Save
   your form. 4. Pop this snippet in your theme `functions.php` file:
 *     ```
       function child_theme_happyforms_part_value( $value, $part, $form ) {
       	if ( strpos( $part['css_class'], 'happyforms-part-page-id' ) !== false ) {
       		$value = get_permalink();
       	}
   
       	return $value;
       }
   
       add_filter( 'happyforms_the_part_value', 'child_theme_happyforms_part_value', 10, 3 );
       ```
   
 * 5. Refresh the page containing your form, and check the value of this new part
   we just added. It should contain the current page address.
 * Let’s nail this down first. If everything worked, we’ll proceed hiding this part
   with a bit of CSS.
 * Let us know how you go!
 *  Thread Starter [root09](https://wordpress.org/support/users/root09/)
 * (@root09)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11117545)
 * Hey [@thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * its working !
    look > ht[tps://prnt.sc/mam7g8](https://prnt.sc/mam7g8)
 * email result > > [https://prnt.sc/mam7ob](https://prnt.sc/mam7ob)
 * now, we must hide the field 🙂
 * thanks !
 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11117618)
 * Great news, [@root09](https://wordpress.org/support/users/root09/)! 👏
 * Hiding it is just a matter of simple CSS. Pop this in your **Appearance** → **
   Customize** → **Additional CSS** screen:
 *     ```
       .happyforms-part-page-id {
           display: none;
       }
       ```
   
 * That should do the job. Let us know if that worked!
 *  Thread Starter [root09](https://wordpress.org/support/users/root09/)
 * (@root09)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11118031)
 * [@thethemefoundry](https://wordpress.org/support/users/thethemefoundry/) …
 * is working with ” !important ”
 *     ```
       .happyforms-part-page-id {
           display: none !important;
       }
       ```
   
 * also i have put your code in the “mu-plugin ”
    to avoid any problem with theme
   update.
 * many tanks 🙂
 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11119825)
 * Oh, okay! Glad to hear we could help, [@root09](https://wordpress.org/support/users/root09/)
   👏
 * Let us know if you ever have more questions!

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

The topic ‘How to include a referer ?’ is closed to new replies.

 * ![](https://ps.w.org/happyforms/assets/icon-256x256.png?rev=2778164)
 * [Happyforms - Form Builder for WordPress: Drag & Drop Contact Forms, Surveys, Payments & Multipurpose Forms](https://wordpress.org/plugins/happyforms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/happyforms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/happyforms/)
 * [Active Topics](https://wordpress.org/support/plugin/happyforms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/happyforms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/happyforms/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/how-to-include-a-referer/#post-11119825)
 * Status: resolved