Sorting page checkbox result (1 post)

  1. David Ferrari
    Posted 2 years ago #

    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? :)


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • OptionTree
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic