i have been trying to display all posts of similar category on one page (best ones)
work fine with is_home() but isn't working with is_page() or is_category().
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
If it works with
is_home() then I think it is just a problem with your slug.
Have you tried to check the
is_page by it ID directly?
Something like this should return
* Returns true when the Pages displayed is either post ID 1,
* or post_name "top-best", or post_title "Top Best".
* Note: the array ability was added in version 2.5.
is_page( array( 1, 'top-best', 'Top Best' ) );