How do I detect the page ID value of the currently loaded page?
I'd like to use the switch/case statement block to choose a sidebar (in sidebar.php) based on which page is currently loaded.
In pseudocode, here's what I'd like to do as a set of switch/case statements, but I don't know if WordPress supports telling me what the current page ID is so I can pass it to switch.
SWITCH (the current page id)
in CASE the current page id is 123
Use dynamic sidebar named 'about-us-widget-area'
in CASE the current page is 234
Use dynamic sidebar named 'press-widget-area'
in CASE the current page is 345
Use dynamic sidebar named 'careers-widget-area'
etc.etc.etc.
Otherwise
Use dynamic sidebar named 'primary-widget-area'
Thanks.