Home Forums WordPress Theme Support MobilityApp Dont want contact form on all pages except Home Page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Evangelist Software
    Participant

    How can i remove contact form from all other pages of my site except Home page?

    Max
    Keymaster

    Hi,

    In footer.php file find this code:

    Code:
    <?php $error1 = true; if(isset($_POST['email1'])) { include(THEME_FUNCTIONS . '/sendmail2.php'); }

    if ( get_option(PREFIX.'_enable_contact_form')=="true" )
    {?>

    <!– footer contact form –>
    <div class="contact-form-footer" id="footer-form">
    <h2><?php _e('Send us a message:','tfuse');?></h2>

    <a name="contact1"></a>

    <form action="" method="post" class="ajax_form1" name="contactForm1">
    <input type="hidden" name="temp_url1" value="<?php bloginfo('template_directory'); ?>" />
    <input type="hidden" id="tempcode1" name="tempcode1" value="<?php echo base64_encode(get_option('admin_email')); ?>" />
    <input type="hidden" id="myblogname1" name="myblogname1" value="<?php bloginfo('name'); ?>" />

    <?php if (!isset($error1) || $error1 == true){ ?>

    <div class="form_block_1">

    <div class="row field_text">
    <input name="yourname1" value="<?php _e('Name','tfuse'); ?>" onfocus="if (this.value == '<?php _e('Name','tfuse'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Name','tfuse'); ?>';}"id="name1" class="inputtext input_middle required" size="40" type="text" />
    </div><!– /. field_text –>

    <div class="row field_text">
    <input name="email1" id="email1" class="inputtext input_middle required" size="40" type="text" value="<?php _e('Email','tfuse'); ?>" onfocus="if (this.value == '<?php _e('Email','tfuse'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Email','tfuse'); ?>';}" />
    </div><!– /. field_text –>

    <div class="row field_text">
    <input name="subject1" id="subject1" class="inputtext input_middle required" size="40" type="text" value="<?php _e('Subject','tfuse'); ?>" onfocus="if (this.value == '<?php _e('Subject','tfuse'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Subject','tfuse'); ?>';}" />
    </div><!– /. field_text –>

    <div class="clear"></div>

    </div><!– /. form_block_1 –>

    <div class="form_block_2">

    <div class="row field_textarea">
    <textarea id="message1" name="message1" class="textarea textarea_middle required" cols="40" rows="8" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"><?php _e('Message','tfuse'); ?></textarea>
    </div><!– /. field_textarea –>

    </div><!– /. form_block_2 –>

    <div class="form_block_3">

    <div class="row">
    <span class="reset-link"><a href="#" onclick="document.contactForm1.reset();return false"><?php _e('reset all fields', 'tfuse') ?></a></span>
    <input value="<?php _e('Submit', 'tfuse') ?>" name="Send" title="send" class="btn-submit" id="send1" type="submit" />
    </div><!– /. row –>

    </div><!– /. form_block_3 –>

    <?php } else { ?>

    <br>

    <h3 style="width:100%;"><?php _e('Your message has been sent!', 'tfuse') ?></h3>

    <div class="confirm">

    <p class="textconfirm"><br /><?php _e('Thank you for contacting us,', 'tfuse') ?><br/><?php _e('We will get back to you within 2 business days.', 'tfuse') ?></p>

    </div>

    <?php } ?>

    <div class="clear"></div>

    </form>

    </div><!– /.contact-form-footer –>
    <!–/ footer contact form –>
    <?php } ?>

    <div class="divider"></div>

    and replace with:

    Code:
    <?php if (is_front_page()) { ?>
    <?php $error1 = true; if(isset($_POST['email1'])) { include(THEME_FUNCTIONS . '/sendmail2.php'); }

    if ( get_option(PREFIX.'_enable_contact_form')=="true" )
    {?>

    <!– footer contact form –>
    <div class="contact-form-footer" id="footer-form">
    <h2><?php _e('Send us a message:','tfuse');?></h2>

    <a name="contact1"></a>

    <form action="" method="post" class="ajax_form1" name="contactForm1">
    <input type="hidden" name="temp_url1" value="<?php bloginfo('template_directory'); ?>" />
    <input type="hidden" id="tempcode1" name="tempcode1" value="<?php echo base64_encode(get_option('admin_email')); ?>" />
    <input type="hidden" id="myblogname1" name="myblogname1" value="<?php bloginfo('name'); ?>" />

    <?php if (!isset($error1) || $error1 == true){ ?>

    <div class="form_block_1">

    <div class="row field_text">
    <input name="yourname1" value="<?php _e('Name','tfuse'); ?>" onfocus="if (this.value == '<?php _e('Name','tfuse'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Name','tfuse'); ?>';}"id="name1" class="inputtext input_middle required" size="40" type="text" />
    </div><!– /. field_text –>

    <div class="row field_text">
    <input name="email1" id="email1" class="inputtext input_middle required" size="40" type="text" value="<?php _e('Email','tfuse'); ?>" onfocus="if (this.value == '<?php _e('Email','tfuse'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Email','tfuse'); ?>';}" />
    </div><!– /. field_text –>

    <div class="row field_text">
    <input name="subject1" id="subject1" class="inputtext input_middle required" size="40" type="text" value="<?php _e('Subject','tfuse'); ?>" onfocus="if (this.value == '<?php _e('Subject','tfuse'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Subject','tfuse'); ?>';}" />
    </div><!– /. field_text –>

    <div class="clear"></div>

    </div><!– /. form_block_1 –>

    <div class="form_block_2">

    <div class="row field_textarea">
    <textarea id="message1" name="message1" class="textarea textarea_middle required" cols="40" rows="8" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"><?php _e('Message','tfuse'); ?></textarea>
    </div><!– /. field_textarea –>

    </div><!– /. form_block_2 –>

    <div class="form_block_3">

    <div class="row">
    <span class="reset-link"><a href="#" onclick="document.contactForm1.reset();return false"><?php _e('reset all fields', 'tfuse') ?></a></span>
    <input value="<?php _e('Submit', 'tfuse') ?>" name="Send" title="send" class="btn-submit" id="send1" type="submit" />
    </div><!– /. row –>

    </div><!– /. form_block_3 –>

    <?php } else { ?>

    <br>

    <h3 style="width:100%;"><?php _e('Your message has been sent!', 'tfuse') ?></h3>

    <div class="confirm">

    <p class="textconfirm"><br /><?php _e('Thank you for contacting us,', 'tfuse') ?><br/><?php _e('We will get back to you within 2 business days.', 'tfuse') ?></p>

    </div>

    <?php } ?>

    <div class="clear"></div>

    </form>

    </div><!– /.contact-form-footer –>
    <!–/ footer contact form –>
    <?php } ?>

    <div class="divider"></div>
    <?php } ?>

    Cheers,

    Max.

    Evangelist Software
    Participant

    Thank u

    beiker
    Participant

    Nice to have this working for you Evangelist. Good luck.

Viewing 4 posts - 1 through 4 (of 4 total)