PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Embed Date Below gform Heading?

  1. I created a short code for displaying the date on my form, and then added the shortcode to a HTML block on the form.

    It does display the date, but it displays it at the top, above the form title and description.

    Is there a way to display it just below the form title and description?

    P.S. - I know I can add a php date function directly to my template, but it would be tidier to put it directly into the form and not have to remember to add it to the template.

    Thanks

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  2. Any shortcodes placed in an HTML field within your form should be output within that HTML field. So it shouldn't be outputting it above the form title and description if you placed it in the HTML field. Is this what is happening?

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  3. No, I have the HTML field placed directly below the form settings (form title and description), but it is displaying ABOVE the entire form in the preview. Maybe a problem with just the preview, and it will work when I put the form into action?

    My code is very straight forward for the shortcode. > http://pastie.org/1823643

    So I do have the HTML field where I want it, but the date is output at the top of the form...
    Any thoughts?

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  4. FYI - I just put the form into a fresh WP page, and it still displays the date at the top....

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  5. Can you post a URL to this new page so we can take a look? Hard to say without seeing the output.

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  6. Unfortunately no, because this is in development on my local machine (I mean I could, but it would take a bit).
    Another clue ... In the HTML field I did have this [formDate] and as I said it displayed the date at the top of the form.
    I have now changed it to: Date: [formDate] and now 'Date:' is displayed in the correct location, but the date is still at the top...?
    Is this a problem with how I am using shortcodes?

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  7. Yes, it's a problem with your code.

    Change this line in your shortcode PHP from this:

    echo date("m/d/Y");

    To this:

    return date("m/d/Y");

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  8. That worked!
    My PHP blunder... :)
    Thanks Carl!
    P.S. - Gravity Forms is a SUPER nice product, with great support!!

    Posted 13 years ago on Friday April 22, 2011 | Permalink

This topic has been resolved and has been closed to new replies.