I had a custom login form in WP(3.1.2) and the problem i was facing is whenever the form was submitted i used to get empty $_POST array.This was my code
<form method=”post” action=”<?php echo bloginfo(’url’).’/?page_id=221′; ?>”>
After some google search I found the solution which was :
<form method=”post” action=”<?php echo $_SERVER['PHP_SELF'].’/?page_id=221′; ?>”>
which means if you are submitting the form on the same page use $_SERVER else you wont get the data in post
Tags: php, wordpress
Posted in tricks on June 7th, 2011 by dharmesh22>
if you have a category called photos and another category called videos , you need to format the single.php differently for each category . this is easy and you can just write the following code in single.php :
if ( in_category(’2′) ) {
include(TEMPLATEPATH . ‘/single-kodetricks.php’);
}
else
include(TEMPLATEPATH . ‘/single-blog.php’);
Tags: wordpress
Posted in tricks on January 20th, 2010 by Karan Ahuja>