How to show post id


#1

use hooks editor to show singe post id,what is the php code?

Attachment Link(s):

http://rtcamp.com/wp-content/uploads/rtMedia/topics/64727/2014/04/6666666.png


#2

Hello Hp3240au,

Try this code,

<?php  
if ( is_single() ) {  
    echo get_the_ID();  
}  
?>

Let me know if its work for you.


#3

ok,thank you
wp3.91version


#4

another question:
can home page show post id too?

Attachment Link(s):

http://rtcamp.com/wp-content/uploads/rtMedia/topics/64743/2014/04/777777.png


#5

Yes, just remove the is_single() condition from above php code.


#6

ok,juse see mysite
Thank you!


#7

@hp3240au

Glad to know your issue got solved. I am closing this support thread. If you face any other issue in future, please create another thread.


#8