php - Add class to single based on the order poistion of posts in Wordpress -


i'm trying create simple system number of posts fixed order of posts can dynamically changed user. "post x" can first in order can later last.

inside admin made simple change order in admin drag , drop.

is possible output class based on position order of post? instance: .order-position-1, .order-position-2 etc. know how echo class inside body.

$extrabodyclasses = array();  if ( is_singular( 'post' ) )  {       array_push($extrabodyclasses, "theclassname"); }  echo body_class($extrabodyclasses);  

how can echo "order postion" of post inside class?

okay, **'ing simple.

get_post_field( 'menu_order', $post_id); 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -