Title: How to insert form code manually without using shortcode
Last modified: August 21, 2016

---

# How to insert form code manually without using shortcode

 *  [article89](https://wordpress.org/support/users/article89/)
 * (@article89)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/)
 * Hi, I need to hack a template and force the php code in the sidebar.php file.
 * The research I did so far tells me to use the following code but it does not 
   work:
 * <?php
    if ( isset($si_contact_form) ) echo $si_contact_form->si_contact_form_short_code(
   array( ‘form’ => ‘1’ ) ); ?>
 * I’m using wordpress 3.4.2 and Plugin version 4.0.16.
 * Can someone please help me out?
 * Thanks a bunch!
 * [http://wordpress.org/plugins/si-contact-form/](http://wordpress.org/plugins/si-contact-form/)

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

 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/#post-4289878)
 * You are missing the curly brackets.
 *     ```
       <?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′
 * This may work also:
    `<php? echo do_shortcode('[si-contact-form form="1"]'); ?
   >`
 *  Thread Starter [article89](https://wordpress.org/support/users/article89/)
 * (@article89)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/#post-4289888)
 * Mike, thank you so much for responding quickly. I tried both options and it just
   doesn’t work, the form does not show on the sidebar. This php code is surrounded
   by other php and html code so I decided to paste the entire content of the file
   for you to see if there’s anything around it that might be breaking it. Thanks
   a lot once again.
 * _[please mark any posted code, or better use the pastebin – [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)–
   some of the code below might be broken]
 *     ```
       <?php
       /**
        * The Sidebar containing the main widget area.
        *
        * @package WordPress
        * @subpackage Cyon Theme
        */
   
       ?>
       			<?php if(is_front_page()){ ?>
       				<?php if(of_get_option('homepage_layout')!='general-1column'){ ?>
       					<!-- Sidebars -->
       					<div id="secondary" class="widget-area" role="complementary">
       		<?php cyon_sidebar_before(); ?>
       						<?php if(of_get_option('homepage_layout')=='general-2right'){ ?>
       							<?php dynamic_sidebar( 'right-sidebar' ); ?>
       						<?php }elseif(of_get_option('homepage_layout')=='general-2left'){ ?>
       							<?php dynamic_sidebar( 'left-sidebar' ); ?>
       						<?php } ?>
       						<?php cyon_sidebar_after(); ?>
       					</div>
       				<?php } ?>
       			<?php }elseif( get_post_meta($post->ID,'cyon_layout',true)=='default' || !get_post_meta($post->ID,'cyon_layout',true) ){ ?>
       				<!-- Sidebars -->
       				<div id="secondary" class="widget-area" role="complementary">
   
       <div class="sidebar-community-button">
       <a href="http://www.sunnyside.cc/our-communities/sunnyside-harrisonburg/"><img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/sunnyside-sidebar-sunnyside-communities.png"/></a>
       </div>
       <!--END .sidebar-community-button-->
   
       <div class="sidebar-community-button">
       <a href="http://www.sunnyside.cc/our-communities/kings-grant-martinsville/"><img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/kings-grant-sunnyside-communities.png"/></a>
       </div>
       <!--END .sidebar-community-button-->
   
       <div class="sidebar-community-button">
       <a href="http://www.sunnyside.cc/our-communities/summit-square-waynesboro/"><img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/summit-square-sunnyside-communities.png"/></a>
       </div>
       <!--END .sidebar-community-button-->
   
       <div class="schedule-visit-wrapper">
       <a href="http://www.sunnyside.cc/plan-a-visit/">
       <img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/schedule-an-appointment-sidebar-sunnyside-communities.png"/></a>
       </div>
       <!--END .schedule-visit-wrapper-->
   
       <div class="sidebar-form-wrapper" style="background-color:#73A86F; width:170px; padding: 0 15px;">
       <a href="http://www.sunnyside.cc/contact-us/">
       <h1 style="font-size:19px; text-align:center; padding-top:6px; color:#fff;">Got a</h1>
       <h1 style="font-size:19px; text-align:center; padding:5px 0; color:#fff;">Question?</h1>
       </a>
   
       <php? echo do_shortcode('[si-contact-form form='1']'); ?>
   
       </div>
       <!--END .sidebar-form-wrapper-->
   
       <div class="contact-info-wrapper">
       <img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/contact-us-sidebar-sunnyside-communities.png"/><div style="border:4px solid #73A86F; text-align:center; color:#473E3E; font-size:18px; background-color:#ffffff;">
   
       <div style="margin-bottom:14px !important; line-height:110%; margin-top:10px;">Sunnyside:
       <a href="1-800-237-2257">1-800-237-2257</a></div>
   
       <div style="margin-bottom:14px !important; line-height:110%;"><b>King’s Grant</b>:
       <a href="1-800-462-4649">1-800-462-4649</a></div>
   
       <div style="margin-bottom:14px !important; line-height:110%;"><b>Summit Square</b>:
       <a href="1-800-586-5499">1-800-586-5499</div>
       </div>
   
       </div>
       <!--END .contact-info-wrapper-->
   
       <div class="social-sidebar-wrapper">
   
       <div class="social-button social-gap">
       </a><a href="#"><img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/youtube-sidebar-sunnyside-communities.png"/></a>
       </div>
       <!--END .social-button-->
   
       <div class="social-button">
       <a href="https://www.facebook.com/pages/Sunnyside-Communities/172745656094558"><img src="http://www.sunnyside.cc/wp-content/uploads/2013/11/facebook-blue-sidebar-sunnyside-communities.png"/></a>
       </div>
       <!--END .social-button-->
   
       </div>
       <!--END .social-sidebar-wrapper-->
   
       <div class="myclear"></div>
   
       				</div>
       			<?php }else{ ?>
   
       				<!-- Sidebars -->
       				<div id="secondary" class="widget-area" role="complementary">
       					<?php cyon_sidebar_before(); ?>
       					<?php if(get_post_meta($post->ID,'cyon_layout',true)=='general-2right'){ ?>
       						<?php dynamic_sidebar( 'right-sidebar' ); ?>
       					<?php }elseif(get_post_meta($post->ID,'cyon_layout',true)=='general-2left'){ ?>
       						<?php dynamic_sidebar( 'left-sidebar' ); ?>
       					<?php } ?>
       					<?php cyon_sidebar_after(); ?>
       				</div>
       			<?php } ?>
       ```
   
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/#post-4289889)
 * Why not try adding shortcode into a new text widget in the WP admin screen?
    
   [http://www.fastsecurecontactform.com/sidebar-widget](http://www.fastsecurecontactform.com/sidebar-widget)
   See if that works
 *  Thread Starter [article89](https://wordpress.org/support/users/article89/)
 * (@article89)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/#post-4289891)
 * I had to hack all this code into the sidebar.php because the widgets were not
   being displayed properly in all pages with sidebars. Now, the sidebar shows great
   in all the pages but the the form still doesn’t. So to answer your question, 
   I can’t do that. What else can I try?
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/#post-4289952)
 * I do not have support for theme templates, you could try the theme support. sorry.
   The code I gave you is correct.

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

The topic ‘How to insert form code manually without using shortcode’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/si-contact-form_dde2be.svg)
 * [Fast Secure Contact Form](https://wordpress.org/plugins/si-contact-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/si-contact-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/si-contact-form/)
 * [Active Topics](https://wordpress.org/support/plugin/si-contact-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/si-contact-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/si-contact-form/reviews/)

## Tags

 * [manually](https://wordpress.org/support/topic-tag/manually/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [shorcode](https://wordpress.org/support/topic-tag/shorcode/)

 * 5 replies
 * 2 participants
 * Last reply from: [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-insert-form-code-manually-without-using-shortcode/#post-4289952)
 * Status: not resolved