Get page id when using permalinks
-
I want to start using permalinks with my theme and ran across the following issue:
I have a template that is used for multiple WP Pages. At the beginning of the page I cache the page id in the following manner:
$cached_page_id = $_GET['page_id']
for use in other functions. For example to set the sidebar based on the currently viewed page.
With permalinks turned on and URI rewriting, the page_id is no longer in the request object.
Is there a way to obtain the current page id when using permalinks?
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Get page id when using permalinks’ is closed to new replies.