Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jamajamajaaama

    (@tipone)

    Some workaround – lame one

    $parent1 = $post->post_parent;
    $parent2 = $wpdb->get_var(“SELECT post_parent FROM $wpdb->posts WHERE ID=$parent1”);

    if (!($parent1==’318’||$parent2==’318′)){

    include “news.php”;

    } ?>

    $current = $post;
    while($current->post_parent) {
    $current = get_post($current->post_parent);
    }

    $parent_id = $current->ID;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get id of the parents parent’ is closed to new replies.