WordPress.org

Ready to get started?Download WordPress

Forums

Get value of page order field (3 posts)

  1. kcomphlint
    Member
    Posted 3 years ago #

    I am wanting to test the value of the "Order" field of a page. Do I use $menu_order to do this? I tried this, but it did not work:

    if( $menu_order == 1 ){
    	echo '<div class="product first">';
    } else {
    	echo '<div class="product">';
    }

    This actually applies the class="product first" to all the items, not just the one with the order value of 1.

  2. jhodara
    Member
    Posted 3 years ago #

    I need the answer to this too! You find it?

  3. Omnilogic
    Member
    Posted 2 years ago #

    You have likely figured this one out by now but I thought I would post the answer for others.
    I wanted to display the page order as a column in the backend. I used the following:
    echo $post->menu_order;
    Hope that helps.

Topic Closed

This topic has been closed to new replies.

About this Topic