id adresi bilinen sayfayı çağırmak ve bu sayfanın alt sayfalarını çağırmak. dosya
<!-- aktif sayfanın id ni almak --> <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <div style="display:none;"> <?php $k_id =get_the_ID(); ?> </div> <?php endwhile; ?> <?php endif; ?> <!-- #aktif sayfanın id ni almak# --> <!-- bilinen id ye ögre sayfa çağırmak $k_id yerine bilinen id de yazıla bilir --> <?php $the_query = new WP_Query( 'page_id='.$k_id ); ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <h1 class="baslik"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1> <?php the_title(); ?> <?php the_content(); ?> <?php the_ID(); ?> <!--- kısa yazı ve tarih almak --> <div style="padding:20px; border:2px #333 solid;"> <!-- resim almak --> <?php if ( has_post_thumbnail() ) { ?> <div class="resim4" style="padding:0px; margin:0; width:150px; height:150px; overflow:hidden;" > <?php the_post_thumbnail(250,200); ?> </div> <?php } ?> <!-- #resim almak# --> <div class="tarih"> <?php the_time('j-F-Y') ?> </div> <span> <b><?php the_title(); ?></b><br /> <?php the_content_rss('', FALSE, '', 2); ?> </span> <div style="text-align:right;"> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="devam"> Devamı</a> </div> </div> <!-- # kısa yazı ve tarih almak --> <?php endwhile;?> <!-- # bilinen id ye ögre sayfa çağırmak $k_id yerine bilinen id de yazıla bilir # --> <!-- alt sayfalar --> <?php $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=1'); // kriterlerimiz if ($children) { ?> // koşulumuz <ul> <?php echo $children; ?> // listemizin elemanları </ul> <?php } ?> <!-- #alt sayfalar# --> <br /> ---- <br /> <!-- üst sayfalar --> <?php $children = wp_list_pages('title_li=&parent_of='.$post->ID.'&echo=1'); // kriterlerimiz if ($children) { ?> // koşulumuz <ul> <?php echo $children; ?> // listemizin elemanları </ul> <?php } ?> <!-- #üst sayfalar# --> ----------------<br> <?php if ( $post->post_parent ) { $children = wp_list_pages( array( 'title_li' => '', 'child_of' => $post->post_parent, 'echo' => 0 ) ); $title = get_the_title( $post->post_parent ); } else { $children = wp_list_pages( array( 'title_li' => '', 'child_of' => $post->ID, 'echo' => 0 ) ); $title = get_the_title( $post->ID ); } if ( $children ) : ?> <h2><?php echo $title; ?></h2> <ul> <?php echo $children; ?> </ul> <?php endif; ?> ----------------<br> </div> <?php // get_sidebar(); ?>