Bhagwat Singh

PHP Developer Portfolio

WordPress

Hello everyone. here in this page wordpress related issues and solutions.

Show Posts Order By Date in a Category Page


if(is_category()){
$category = get_the_category();
$category_id = $category[0]->term_id;
//$category_id = get_cat_ID($category->cat_ID);
$args = array(
'cat' => $category_id,
'orderby' => 'post_date',
'order' => 'ASC'
);
query_posts( $args );
}

Add A Page Template In WordPress

coming soon…

Checking if Database Table exists

To determine if the table exists. we need to do the following code.

if($wpdb->get_var(“SHOW TABLES LIKE ‘$table_name'”) == $table_name)
{//Table Exists}
else
{//Table Not Exists}

Site Nevigation