• Forum
  • FAQ
  • Docs
Notice: In order to post a support question you have to have an account and be logged in.
Register  or  Login
  1. How can i remove contact form from all other pages of my site except Home page?

  2. Hi,
    In footer.php file find this 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:
    <?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.

    Max
    2 years ago
  3. Thank u

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

    beiker
    2 years ago

Add Reply

You must log in to post.

 

Add a new topic!

Chances are your issue is already answered, but if it’s not, you can always create a new topic.

Add new topic

Search forums

Searching for something specific? Type something and press Enter to search.