To enable guest comments in WordPress
- Go to Settings=> Discussion
Tutorialshore
To enable guest comments in WordPress
To add dynamic PHP page in wordpress
1) Create a page home_new.php with below content
/* Template Name: home new page */ get_header();
echo “Hello”;
2) Upload this php file into selected Theme home folder
3) Create a new page from admin side
Select home new page (This is what we added in step 1) in the template list from right side
4) Find the newly created page link
you can see the out put ” Hello”
5) whateverv php code you added in home_new.php will come in that link
Here is displaying the post with WP_Query meta_key date greater than today
$today = date(‘Ymd’);
$args = array(
‘numberposts’ => -1,
‘posts_per_page’ => 1,
‘meta_key’ => ‘game_time’,
‘meta_value’ => $today,
‘meta_compare’ => ‘<'
);
// query
$the_query = new WP_Query( $args );
To get Selected database use
$res = mysql_query(“SELECT DATABASE()”) or die(mysql_error());
echo mysql_result($res ,0);
To get current username
$res = mysql_query(“SELECT CURRENT_USER”) or die(mysql_error());
echo mysql_result($res ,0);