Support » Themes and Templates » using the_id()

  • Resolved rogueslg71

    (@rogueslg71)


    i want to display the number of the post BEFORE the one being viewed on the screen. so if im on post 4, i would like to echo ‘3’ in php.

    i thought that the_id() gives the post number (which it does) but since its a number, why doesnt it subtract one when i say $previousnum = the_id() -1 ; ? if i echo this, it turns out ‘4 – 1’. how can i get it to do the calculation, instead of treating it as a string ?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘using the_id()’ is closed to new replies.