Ready to get started?Download WordPress


Page ID with permalinks (3 posts)

  1. nite_man
    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,


  2. Kafkaesqui

    Posted 8 years ago #

    Example code here:


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

  3. nite_man
    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