Thread Starter
bpai
(@bpai)
There must be a solution! I really need you help guys!
Hi everybody,
I’ve got 10 parent pages each with appr 50 children pages I need to display the last in 4 or 5 columns plus thumbnails on their parents. The code above is perfect, but I’ve got a very ling list. That’s why I need to brake it in columns.
Any suggestions how to do this?
I’ve found this code, but I have no idea how to add the thumbnails here:
<?php
$get_pages = wp_list_pages( 'echo=0&title_li=&depth=1&hide_empty=0&child_of=1564' );
$page_array = explode('',$get_pages);
$columns = 4;
$pages_shown = 0;
echo '<ul style="display:inline;">';
foreach($page_array as $page) {
$pages_shown++;
$page = str_replace('<li','<li style="display:inline"',$page);
$page = str_replace('<a href','<a style="width:160px;display:block;float:left" href',$page);
if($pages_shown % $columns == 0) {
print $page.'<ul style="display:inline;">';
}
else {
print $page.'';
}
}
echo '';
?>
Any help would be appreciated!