WordPress.org

Ready to get started?Download WordPress

Forums

Problem inserting Contact Form 7 into a custom field template (5 posts)

  1. greenday
    Member
    Posted 5 years ago #

    I am copying and pasting

    [contact-form 1 "Contact form 1"]

    into a custom field template, but it shows as just the plain text and not the form. If I paste it into the main wysiwyg area it shows fine. What am i doing wrong - do i have to configure the custom field tempplates? I have allready got 'Use the shortcode in the widget' ticked.

    Any help much appreciated.

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    You can't use shortcodes in page templates. They have to be parsed via something like the_content(). So, edit your custom template to simply use the_content() where you want the form to appear. Then create the page via the WP Admin, assign the new template and add the contact form shortcode in the main wysiwyg area.

  3. greenday
    Member
    Posted 5 years ago #

    Hi Thanks so much for your reply. If this is what i think it means, it seriously limits WordPress as a CMS?

    Please have a quick look at my site http://myjeweller.co.nz/site/contact

    I have set the page up as 4 columns from left to right, using the custom field template for the last 3. Does this mean that only 1 column can ever contain short code such as a gallery or contact form ect? Or have I gone about this the wrong way?

    I was hoping the customer could add elements where ever they wanted easily?

    Thanks.

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    it seriously limits WordPress as a CMS?

    In what way? I've found it works really well as a CMS.

    If you want your clients to be able to add elements to sidebars (or pages) easily, then use widgets rather than shortcodes. They can then be added to any widget-ready area.

  5. bento
    Member
    Posted 4 years ago #

    Hi guys,

    This worked for me:
    <?php echo do_shortcode('[contact-form 1 "Contact form 1"]'); ?>

    Hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.