is_page no longer works, how do I find out which page user is in
-
I really can’t understand why is_page no longer works in some buddypress pages, it was a very simple and elegant way of finding out what page you’re on. Can someone help me with this:
I WANT:
1. If the current page is X
2. Display a certain piece of code, or change some css stylingREALLY, that’s it!!!!!!
Here’s an example that still works:
<?php if ( is_home() ) : ?> <style>.homepage i {color:#ffd647 !important;}</style> <?php endif; ?>
Here’s an example that no longer works:
if ( is_page( 'forums' )) : ?> <style>.homepage i {color:#ffd647 !important;}</style> <?php endif; ?>
The only difference between those two that I can find is that in the second example I went into a buddypress page.
VERY IMPORTANT NOTE:
I want to use this sort of function in a granular level, so for instance if the current page slug is http://mysite.com/forums/forum/some-forum/ , I want to be able to call something like if ( is_page( ‘some-forum’ ))Hope that makes sense. Maybe there’s something wrong with my code as I’m not a programmer, but THIS IS SUCH A BASIC FUNCTION, why isn’t it better documented????????????
Pls help!!
- You must be logged in to reply to this topic.