WordPress.org

Ready to get started?Download WordPress

Forums

help with my contact page (3 posts)

  1. marciadacol
    Member
    Posted 1 year ago #

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    My contact page is not working can some help me?

    <?php
    /*
    Template Name: Contact
    */
    
    //post query
    $query = new WP_Query( 'post_type=page&page_id='.$post->ID );
    ?>
    <div class="content_inner page-page-contact">
    <?php if ($query->have_posts()) : while ( $query->have_posts() ) : $query->the_post();  ?>
    <?php the_content(); ?>
    <?php endwhile;	endif; wp_reset_query(); ?>
    <div class="contact-form">
    	<?php
    	//contact form
    	$forms=TmkRenderer::parseFields(get_option(THEME_PREFIX.'forms'));
    	$contact_form=get_option(THEME_PREFIX.'contact_form');
    	if(isset($forms) &&  $contact_form!='') {
    		$form=$forms[$contact_form];
    		if(isset($form)) {
    	?>
    		  <?php if(isset($contact_form)) { ?>
    		  <h3><?php echo $contact_form; ?></h3>
    		  <?php } ?>
    		  <div id="message"></div>
    		  <form method="post" action="<?php echo get_template_directory_uri(); ?>/extensions/contact-form/contact.php" name="contactform" id="contactform">
    			  <fieldset>
    			  <?php
    			  foreach($form['fields'] as $field) {
    				if($field['type']!='[c]') {
    			  ?>
    				<div class="row"><?php echo $field['out']; ?><?php if($field['type']!='[m]') { ?><label><?php echo $field['value']; ?> <sup>*</sup></label><?php } ?></div>
    			  <?php
    				}
    			  }
    			  if($form['captcha']=='true') { ?>
    			  <div class="row">
    			  <p class="alignleft"><?php _e('Are you human?','styletheme'); ?> <sup>*</sup></p>
    			  <div class="captcha-container">
    				  <input name="verify" type="text" id="verify" size="6" value="" style="width: 45px; float:left; margin-top:-1px; margin-left:10px;" />
    				  <label style="display:block; float:left; " for=verify accesskey=V><img src="<?php echo get_template_directory_uri(); ?>/extensions/contact-form/image.php" border="0" alt="" /></label>
    				  <div class="clear"></div>
    			  </div>
    			  </div>
    			  <?php } ?>
    			  <input type="hidden" name="form_name" id="form_name" value="<?php echo $contact_form; ?>" />
    			  <input type="submit" class="submit-form" id="submit" value="<?php _e('Send','styletheme'); ?>" />
    			  </fieldset>
    	          </form>
    
                <?php
                                   }
                            }
                        ?>
    
    </div>
    
    </div><!--/ contact-form-->
    </div><!--/ content_inner-->
  2. AMEEKER
    Member
    Posted 1 year ago #

    <?php
    /*
    Template Name: Contact
    */
    
    //post query
    $query = new WP_Query( 'post_type=page&page_id='.$post->id );
    ?>
    
    <div class="content_inner page-page-contact"><?php if ($query->have_posts()) : while ( $query->have_posts() ) : $query->the_post();  ?><?php the_content(); ?><?php endwhile; endif; wp_reset_query(); ?>
    <div class="contact-form"><?php
            //contact form
            $forms=TmkRenderer::parseFields(get_option(THEME_PREFIX.'forms'));
            $contact_form=get_option(THEME_PREFIX.'contact_form');
            if(isset($forms) &&  $contact_form!='') {
                    $form=$forms[$contact_form];
                    if(isset($form)) {
            ?><?php if(isset($contact_form)) { ?>
    <h3><?php echo $contact_form; ?></h3>
    <?php } ?>
    <div id="message"></div>
    <form method="post" action="%3C?php%20echo%20get_template_directory_uri();%20?%3E/extensions/contact-form/contact.php" name="contactform" id="contactform">
    <fieldset><?php
                              foreach($form['fields'] as $field) {
                                    if($field['type']!='[c]') {
                              ?>
    <div class="row"><?php echo $field['out']; ?><?php if($field['type']!='[m]') { ?><label><?php echo $field['value']; ?> <sup>*</sup></label><?php } ?></div>
    <?php
                                    }
                              }
                              if($form['captcha']=='true') { ?>
    <div class="row">
    <p class="alignleft"><?php _e('Are you human?','styletheme'); ?> <sup>*</sup></p>
    <div class="captcha-container"><input name="verify" type="text" id="verify" size="6" value="" class="c1"> <label class="c2" for="verify" accesskey="V"><img src="%3C?php%20echo%20get_template_directory_uri();%20?%3E/extensions/contact-form/image.php" border="0" alt=""></label>
    <div class="clear"></div>
    </div>
    </div>
    <?php } ?><input type="hidden" name="form_name" id="form_name" value="<?php echo $contact_form; ?>"> <input type="submit" class="submit-form" id="submit" value="<?php _e('Send','styletheme'); ?>"></fieldset>
    </form>
    <?php
                                   }
                            }
                        ?>
    <!--contact-form-->
    <!--content_inner-->

    You can try this. No promises, if it doesn't work, you can go back to what you have above.

  3. marciadacol
    Member
    Posted 1 year ago #

    Thanks but didn't work.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.