lundi 5 octobre 2015

Order page listing by postdate desc

I had made gallery with a tumbnails with wordpress but I have a little problem on it. All my gallerys are wordpress classic pages , which are child pages of (editorial,personal,fashioned - one of them) . And this parent pages(editorial,personal,fashion) are child of PHOTOGRAPHY page. When I'm listing my thumbnails it is first listing ALL EDITORIAL PAGES,AFTER ALL PERSONAL,AND AFTER ALL FASHION BUT NOT THE LAST ADDED ITEM. I need to mix the results by date to display correctly latest item , not separated results like now. I'll show what I have maybe somebody have any ideas...Also I'll attach little screenshot to make my question more clear. Also there is another way to solve this problem just to list PHOTOGRAPHY parent page(contains childs 403,414,417) but in this case i need to exclude this 3 parent pages from listing but keep their child pages. I'm noob in coding so will be happy for any qnaswer ^ THANKS

WHAT I HAVE

<div class="base-content">

<div id="archive-thumbnails-listing" >
<?php $pages = array();
foreach (array(403, 414, 417) as $id) {
$pages = array_merge($pages, get_pages(array('child_of' => $id ,'sort_column' => 'post_date', 'sort_order' => 'desc' )));
} ?>
<?php foreach ($pages as $page): ?>
<div class="thumb12wrap"> 
<a href="<?php echo get_the_permalink($page->ID); ?>"> 
<?php echo get_the_post_thumbnail($page->ID, 'full'); ?></a> 
<div class="thumbwrapper88"> 
<div class="shade23desc" ><a class="desc" href="<?php echo get_the_permalink($page->ID); ?>"><?php echo $page->post_title; ?></a></div> 
<a class="descarea" href="<?php echo get_the_permalink($page->ID); ?>"></a> 
</div>
</div>   
<?php endforeach; ?>
</div>
<div style="float:left;height:50px;width:100%;position:relative;"></div>
</div>

this 403 is editorial(parent page) , 414 (personal parent page) 414 (fashion parent page)

http://ift.tt/1LtH3QL IMAGE



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire