Archive for February, 2010

Different single post template per category wordpress

Different single post template per category wordpress

If you want to display single post page using different single post template, then wordpress in_category() function will help to create different single post template. First thing you have to create different single post template like single_portfolio.php single_news.php single_wordpress.php single_default.php //For default single post template for post other than above categories. Above three files i [...]

WordPress get all subpages of current page’s parent page

WordPress get all subpages of current page’s parent page

Following code will display all the subpages of same parent page. also displays the subpages of current page if it is not a subpage. <?php if($post->post_parent) { $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0$sort_column=menu_order"); $title_heading = get_the_title($post->post_parent); } else { $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); $title_heading = get_the_title($post->ID); } if ($children) { ?> <h2> <? echo $title_heading ?> </h2> <ul> <?php [...]