WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show ID (8 posts)

  1. roxer82
    Member
    Posted 7 years ago #

    I would like to know how can I show the ID of the article at the site's home, I was searching but didn't find how to show that info. I hope someone can help me.
    Thanks in advanced!

  2. Joshua Sigar
    Member
    Posted 7 years ago #

    Use the following template tag within the Loop.

    the_ID()

    http://codex.wordpress.org/Template_Tags/the_ID

  3. roxer82
    Member
    Posted 7 years ago #

    Thanks but is it posible to put it in a variable?

  4. Joshua Sigar
    Member
    Posted 7 years ago #

    $postID = get_the_ID();

  5. roxer82
    Member
    Posted 7 years ago #

    Thanks! :)

  6. roxer82
    Member
    Posted 7 years ago #

    Fo some razon $postID = get_the_ID(); seems to not be working but this worked:
    $postID=$post->ID;

    One more question, do you know how is it posible to get the cat ID too?

  7. Joshua Sigar
    Member
    Posted 7 years ago #

  8. roxer82
    Member
    Posted 7 years ago #

    thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags