Sorting page checkbox result
-
Hi, I need help to sort the page checkbox result.
I’m using this option to show some pages in a static home pages, but I’d like to sort them by page order (menu_order).
This is my code:
============
if ( function_exists( ‘ot_get_option’ ) ) {
$home_page_content = ot_get_option( ‘home_page_content’, array() );
if ( ! empty( $home_page_content ) ) {
foreach( $home_page_content as $home_page_element_id ) {
$page_data = get_page( $home_page_element_id );
echo ‘<h3>’. $page_data->post_title .'</h3>’;
echo apply_filters(‘the_content’, $page_data->post_content);
echo ‘<h2>’. $page_data->menu_order .'</h2>’;
}
}
else {echo ‘Please select at least one page from Apparence => Theme Options => General Settings => Home Page Content‘;}
}
else {echo ‘Option tree disabled’;}
============I guess I’ve to create a new array, sort it out and then echo the page data, but I’m a little stuck..
Any help? 🙂
Thanks
The topic ‘Sorting page checkbox result’ is closed to new replies.