WordPress.org

Ready to get started?Download WordPress

Forums

Page ID with permalinks (3 posts)

  1. nite_man
    Member
    Posted 8 years ago #

    Hi there!

    I have a simple question about getting page ID inside plugin.
    I saw a variable $page_id is global and without permalink it contains correct page ID. But when I try to use this variable in case using permalink it's empty.

    So, my question is how to possible get page/post ID if permalink is used.

    Thanks in advanced,

    Michael.

  2. Kafkaesqui

    Posted 8 years ago #

    Example code here:

    http://wordpress.org/support/topic/57611#post-311586

    Just swap out is_single() for is_page() ...

  3. nite_man
    Member
    Posted 8 years ago #

    Thanks a lot, Kafkaesqui, for your answer. It helped me!

Topic Closed

This topic has been closed to new replies.

About this Topic