Tag Archives: page

Avoid Static page link like get_permalink()

Avoid Static page link with get_permalink(10) Use below code and make your code standard.

$pages = get_pages(array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-template/case-results.php'
foreach($pages as $page){
$custom_pade = $page->ID;
<a class="button4" href="<?php echo get_permalink($custom_pade); ?>"><strong>View All</strong></a>


Child pages of parent page menu in sidebar

You can also use this plugin:
if u want add main title as main page then use this plugin:
by default all childpages short by name, if u want add desiding order then:
got to plugin’s => edit => and replace this line
$pages = wp_list_pages(‘depth=0&title_li=&child_of=’.$id.’&echo=0&sort_column=menu_order’);

past in sidebar.php 

<?php global $post;?>
$parent_title = get_the_title($post->post_parent);
$children = wp_list_pages(“depth=1&title_li=&child_of=”.$post->post_parent.”&echo=0″); // append the list of children pages to the same $children variable
if ($parent_title) { ?>
<h2 class=”widgettitle”><?php echo $parent_title; ?></h2>
<?php }

if ($children) { ?>
<ul class=”submenu”>
<li><?php echo $children; /*print list of pages*/ ?></li>
<?php } ?>

%d bloggers like this: