Our programmer here and at AIMseo developed a PHP code to randomize the sub pages or child pages in wordpress. This code will display links at random displaying 10 sub page titles. Insert this code into your page.php file where you would like it to be displayed.
click here for example example
<?php
$sub_pages = get_pages( 'depth=1&child_of=' . $post->ID .'&parent=' . $post->ID );
if(is_array($sub_pages)) {
shuffle($sub_pages);
$sub_pages = array_slice($sub_pages,0,10);
}
?>
<?php if (is_array($sub_pages) && count($sub_pages) > 0):?>
<ul style="padding: 0 0 0 10px;">
<? foreach($sub_pages as $page): ?>
<li><a href="<?=get_permalink($page->ID);?>"><?=$page->post_title;?></a></li>
<? endforeach; ?>
</ul>
<?php endif;?>
Tuesday, December 15th, 2009 at 5:02 pmand is filed under SEO Articles. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
You must be logged in to post a comment.
We are a (SEO)Search Engine Optimization, Pay Per Click, and Internet Marketing Company Located in Traverse City Michigan (MI).