WordPress.org

Ready to get started?Download WordPress

Forums

getting the post iD outside of the loop (1 post)

  1. drazin
    Member
    Posted 8 years ago #

    is it possible to generate the post ID outside of the loop?

    <?php the_ID(); ?> will not work when put in a javascript in my <head>

    i want to use this on a page where there are multiple posts.

    i want to include the post id in a javascript function and it wont work outside of the loop.

    is that possible?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags