WordPress Help

Hi everyone,

I am trying to change my static website in to Wordpress and just got myself into a right pickle and really need some help here,
as i have just come across two problems with my site http://all-wired.co.uk/.

1, I cant get my featured content to work properly on the home page.

2, I cant get my contact forms to work on my home page and on my contact form page.

And solving these problems would be a great help, as i would be able to overcome them for future projects.
So if anyone knows the answer pls let me know.

Thanks

Are you using any plugins for either item? If so, which ones?

No, i am using a ws-slides slide show which i got of the internet. But it looks they have changed up the website since i was last on there.
And I just created the contact forms myself.

Okay, I’m still investigating the ws-slides, but can you tell me more about your contact forms?

I see it is posting the data back to index.php, can you post the code you added to index.php to process the contact form?

ok thanks, well this is the original code for the ws-slides

<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“utf-8”>

&lt;title&gt;Slides, A Slideshow Plugin for jQuery&lt;/title&gt;

&lt;style type="text/css" media="screen"&gt;
	/*
		Load CSS before JavaScript
	*/
	
	/*
		Slides container
		Important:
		Set the width of your slides container
		Set to display none, prevents content flash
	*/
	.slides_container {
		width:470px;
		display:none;
	}

	/*
		Each slide
		Important:
		Set the width of your slides
		If height not specified height will be set by the slide content
		Set to display block
	*/
	.slides_container div {
		width:470px;
		height:170px;
		display:block;
	}
	
	/*
		Optional:
		Reset list default style
	*/
	.pagination {
		list-style:none;
		margin:0;
		padding:0;
	}

	/*
		Optional:
		Show the current slide in the pagination
	*/
	.pagination .current a {
		color:red;
	}
&lt;/style&gt;

&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="js/slides.min.jquery.js"&gt;&lt;/script&gt;

&lt;script&gt;
	$(function(){
		$('#slides').slides({
			preload: true,
			generateNextPrev: true
		});
	});
&lt;/script&gt;

</head>
<body>
<div id=“slides”>
<div class=“slides_container”>
<div>
<h1>Slide 1</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div>
<h1>Slide 2</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div>
<h1>Slide 3</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div>
<h1>Slide 4</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
</body>
</html>

This is for the contact form, I used <?php echo $_SERVER[‘PHP_SELF’]; ?> originally but it didnt work so u tried indexed.php to see if it would work.

<h1 class=“contactpage_headings”>Contact Form</h1>
<form id=“contactform” method=“post” action=“<?php echo $_SERVER[‘PHP_SELF’]; ?>”>
<ul>

<li>
<label for=“name”>Full Name:</label>
<input type=“text” name=“name” id=“name” />
</li>

<li>
<label for=“contact”>Company Name:</label>
<input type=“text” name=“cname” id=“cname” />
</li>

<li>
<label for=“contact”>Contact Number:</label>
<input type=“text” name=“number” id=“number” />
</li>

<li>
<label for=“email”>Email:</label>
<input type=“text” name=“mail” id=“mail” />
</li>

<li>
<label for=“message”>Enquiry:</label>
<textarea id=“textarea” name=“message”></textarea>
</li>

<li>
<input type=“submit” id=“submit” value=“Submit”>
</li>
</ul>
</form>
<p id=“contactfeedback”><?php echo $feedback; ?></p>

This is the PHP

<?php

$to = ‘’;
$subject = ‘Email From’;

$name = $_POST[‘name’];
$cname = $_POST[‘cname’];
$number = $_POST[‘number’];
$mail = $_POST[‘mail’];
$message = $_POST[‘message’];

$body = <<<EMAIL

$name

$cname

$number

$mail

$message

EMAIL;

$header = “From: $name”;

if($_POST){

if($name == '' || $number == '' || $mail == ''  || $message == ''){
    $feedback = 'fill out all the fields';	
}else{
    mail($to, $subject, $body, $header);
    $feedback = 'Message sent'; 
}	

}

?>

From the contact form perspective, my suggestion would be to create a new PHP file to process the form.

Example: contact.php

<?php
$to = '';
$subject = 'Email From';

$name = $_POST['name'];
$cname = $_POST['cname'];
$number = $_POST['number'];
$mail = $_POST['mail'];
$message = $_POST['message'];


$body = <<<EMAIL

$name

$cname

$number

$mail

$message

EMAIL;

$header = "From: $name";

if($_POST){
  if($name == '' || $number == '' || $mail == '' || $message == ''){
    $feedback = 'fill out all the fields';
  }else{
    mail($to, $subject, $body, $header);
    $feedback = 'Message sent'; 
  }	

  $_SESSION['feedback'] = $feedback;
  header('Location: index.php');
}
?>

Then point your form action to contact.php
In your template, change this

<p id="contactfeedback"><?php echo $feedback; ?></p>

To

<p id="contactfeedback">
  <?php
    $feedback = '';
    if (isset($_SESSION['feedback']))
    {
       $feedback = $_SESSION['feedback'];
       unset($_SESSION['feedback']);
    }
    echo $feedback; 
  ?>
</p>

From what I can tell, Wordpress is hijacking your form submission, so it is interfering with your form. By moving it to a separate file, it should help ease that pain.

Watching the code makes me headache, I used to use tags to feature content or put the content in a category called “Feature”, or “headline”.
You can use plugn-in for contact forms.