Find Out Current WordPress Page Dynamically
-
I’m basically trying to dynamically call a specific sidebar-xxx.php depending on which author’s page I’m on. I’ve created specific content for each author (6 to be exact) and I want use the get_sidebar(‘authornamehere’) command to pull each author’s sidebar.
The basic approach I took was to set a variable to the current page and strip all folders and just leave the author slug.. from there, using an if statement to load a specific sidebar-xxx.php file depending on the slug..
However, my $currentAuthor = $_SERVER[‘PHP_SELF’] is only returning my wordpress/index.php
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Find Out Current WordPress Page Dynamically’ is closed to new replies.