Anoop Saini

Web Developer

Menu

Skip to content
  • Home
  • PHP
    • MVC
      • Codeigniter
      • CakePHP
  • CMS
    • WordPress
    • Magento
    • Drupal
    • Open Cart
    • Joomal
    • Moodle
  • About
  • HTML
    • ETC
  • jquery
  • Contact
    • anoopsaini.in

Daily Archives: December 11, 2012

Post navigation

Display parent page id using child page

Posted on December 11, 2012 by Anoop Saini

<?php

if ($post->post_parent) {

$ancestors=get_post_ancestors($post->ID);

$root=count($ancestors)-1;

$parent = $ancestors[$root];

} else {

$parent = $post->ID;

} ?>

Rate this:

Posted in Wordpress

Post navigation

2012

December 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Nov   Jan »

CMS

Drupal etc HTML Joomal jquery Magento Moodle Open Cart PHP Wordpress

Latest Post

  • Include a file
  • Condition for Login Logout
  • Call Static image in theme
  • Condition for home page
  • Conditional Tags Test
  • An image make center form every side
  • Implement CSS on All common classes
  • Display woo commerce Reviews on any other Place
  • Update Default Jquery of WP

joinlicpunjab.in

anoopsaini.in

Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • Anoop Saini
    • Already have a WordPress.com account? Log in now.
    • Anoop Saini
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar