mayoosuf
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: blog in non rootWell, @esmi, that was quiet a big one, but ultimately i found an easy one
from Permalink Settings, added a Custom Structure as following;
/blog/%category%/%postname%/
it works without any problem.
Forum: Fixing WordPress
In reply to: blog in non rootThat mean do i have to have 2 installations?
Forum: Everything else WordPress
In reply to: how to set custom title in non root blogthe answer is is_front_page() and is_home()
@kapiljain.in
its a nice code snippet, what I was searching for, and just I got it. thanks!
BTW, if possible an enhancement can be done as if the chilled pages not exist better not to display the title(parent page name).
Forum: Developing with WordPress
In reply to: How to make a custom feedback form without using a plugin?Thank you every one, i made it , but i don’t think its an ultimate solution, hmm you guys also have a look and give me your feedbacks, because, i want to learn more and more.
actually i did’t do any big changes, only few parts, now im thinking of enhancing the code by using a Switch Case
the code is i have written in the template page is
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
/*
Template Name: contact form
*/
?><?php get_header(); ?>
<body id="contactform">
<div id="container">
<?php
if(isset($_POST['submitted'])) {
if($_POST['emailTo'] == '') {
$emailToError = 'You forgot to enter the email address to send to.';
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailTo'])) {
$emailToError = 'Enter a valid email address to send to.';
}
if($_POST['emailFrom'] == '') {
$emailFromError = 'You forgot to enter the email address to send from.';
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailFrom'])) {
$emailFromError = 'Enter a valid email address to send from.';
}if($_POST['subject'] == '') {
$subjectError = 'You forgot to enter the subject.';
}if($_POST['message'] == '') {
$messageError = 'You forgot to enter the message.';
}if(!isset($emailToError) && !isset($emailFromError) && !isset($subjectError) && !isset($messageError)) {
include(TEMPLATEPATH.'/sendEmail.php');
include(TEMPLATEPATH.'/thanks.php');
}
}?>
<form action="<?php echo get_option('siteurl'); ?>/sendemail.php" method="post" id="sendEmail">
<h1>Send An Email</h1>
<p class="alert">* All fields are required</p>
<ol class="forms">- <label for="emailTo">To</label><input type="text" name="emailTo" id="emailTo" value="<?= $_POST['emailTo']; ?>" /><?php if(isset($emailToError)) echo '<span class="error">'.$emailToError.'</span>'; ?>
- <label for="emailFrom">From</label><input type="text" name="emailFrom" id="emailFrom" value="<?= $_POST['emailFrom']; ?>" /><?php if(isset($emailFromError)) echo '<span class="error">'.$emailFromError.'</span>'; ?>
- <label for="subject">Subject</label><input type="text" name="subject" id="subject" value="<?= $_POST['subject']; ?>" /><?php if(isset($subjectError)) echo '<span class="error">'.$subjectError.'</span>'; ?>
- <label for="message">Message</label><textarea name="message" id="message"><?= $_POST['message']; ?></textarea><?php if(isset($messageError)) echo '<span class="error">'.$messageError.'</span>'; ?>
<li class="buttons"><button type="submit" id="submit" value="no">Send Email »</button><input type="hidden" name="submitted" id="submitted" value="true" />
</form>
<div class="clearing"></div>
</div>
<?php get_footer(); ?>please give me your code enhancement teq’s
Forum: Fixing WordPress
In reply to: How to ignore latest postHi Renato
hmm, you mean that i have to make the code like;<?php if ( have_posts() ); ?> <?php query_posts('showposts=5&offset=3'); #it displays 5 records and offset frm third ?> <?php while ( have_posts() ) : the_post(); ?> <div class="post"> <!-- Display the Title as a link to the Post's permalink. --> <h2><a>"> <?php the_title(); ?> </a></h2> <!-- Display the Time. --> <small>on <?php the_time('F jS, Y'); ?> in <?php the_category(', '); ?> </small> <!-- Display the Post's Content in a div box. --> <?php the_content(); ?> <!-- <a href="">Read More</a>--> <div class="separator"></div> </div> <?php endwhile; ?>Thank you very much!!!!