Question on Wordpress PHP Single.php

nam6641

Supreme Member
Joined
Nov 15, 2008
Messages
1,470
Reaction score
926
I have a html code for a form that I want to include on my single.php pages. Below is my single.php. I want to include the form above the post. It seems like no matter where I add the form code it creates an error for me. I know very little about coding so I'm doing trial and error. Any help would be appreciated.

Code:
<?php 
get_header();

if (is_active_sidebar('blog')) get_sidebar('blog');

if (have_posts()) {

	while (have_posts()) : the_post();
		sports_display_post();	
	endwhile;
	
} else { ?>

	<div <?php post_class(); ?>>
		<div class="post-head"></div>
		<div class="post">
			<p><?php _e('Sorry, post is not found.','sports'); ?></p>
			<div class="clear"></div>
		</div>
		<div class="post-foot"></div>
	</div>
	<?php
}

get_footer();
?>

And this is code I want to insert before my post title:

Code:
 <form style="background-image: url('http://mysite.com/banner.png');width: 500px;height: 143px" action="http://mysite.com/results.html "method="post">
        <input type="text" style="width: 85px;height: 10px;margin-left: 59px;margin-top: 111px" name="zipcode" size="10" maxlength="5">
        <input type="image" src="http://mysite.com/button.png" style="height: 18px;width: 93px;margin-left: 0px;margin-top: 110px;position: absolute" onclick="this.form.submit();">
      </form>
 
Nevermind, figured it out... had to close the php, insert form code, then reopen the php tags
 
Back
Top