WordPress.org

Ready to get started?Download WordPress

Forums

Fast Secure Contact Form
Add form with PHP (10 posts)

  1. raynox
    Member
    Posted 3 years ago #

    Hello,

    I'm looking for a way to add at any post (within a specific category), so i have a template for its !

    I just want a PHP code or the way for changing "[si-contact-form form='x']" in the source code. I'm looking for anyway, i think, i'm not the first, can you help me?

    something like "include(...)", it would be the best or better?

    Thanks a lot
    Sorry for mistake, i'm french ;)

  2. rtomasso
    Member
    Posted 3 years ago #

    Ditto this. Would like to be able to make a php function call rather than the shortcode for a template I'm making. Something like:

    <?php fscf('1'); ?>

  3. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    How can I add the contact form to a template manually rather than use shortcode in a page?

    Use this code:

    <?php
    if ( isset($si_contact_form) ) {
     echo $si_contact_form->si_contact_form_short_code( array( 'form' => '1' ) );
    }
    ?>

    Be sure to set the correct form number for example, for form 2 you have to set: ‘form’ => ’2′

  4. rtomasso
    Member
    Posted 3 years ago #

    Didn't work.

  5. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    rtomasso then the place where you put the code either is not a PHP file, or is not including the WordPress plugins initialization. What file and where are you trying to place the code?

  6. rtomasso
    Member
    Posted 3 years ago #

    I put the code inside a Executable PHP widget. I did some more work and the form does display as part of index.php, but doesn't seem to work inside the sidebar processing.

  7. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    Side bar widgets may not have the plugins initialized, that is why I made this FAQ page:
    http://www.fastsecurecontactform.com/sidebar-widget

  8. rtomasso
    Member
    Posted 3 years ago #

    Awesome. That worked.

  9. Chris
    Member
    Posted 3 years ago #

    The code Mike posted to use in the page template worked for me. `<?php
    if ( isset($si_contact_form) ) {
    echo $si_contact_form->si_contact_form_short_code( array( 'form' => '1' ) );
    }
    ?>`

    Thanks Mike! Great Plugin!

  10. GinsBabu
    Member
    Posted 2 years ago #

    Yes....the php code worked for me too...

    But can i know why the shortcode method didn't work?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic