0

This question already has an answer here:

i want to put on navbar to slider when in homepage,also i want to put top navbar when in other pages.so i encoded this:

if ( is_home() ) {
echo'  <nav class="navbar navbar-expand-md navbar-light  sticky-top" style="background-color: rgba(0, 99, 222, 0.2);  width: 100%;" role="navigation">';
} else {
  echo'  <nav class="navbar navbar-expand-md navbar-light  sticky-top" style="background-color: rgba(0, 99, 222, 0.2); position:fixed; width: 100%;" role="navigation">';
}
   ?> 

however the code works perfectly in homepage but it looks like homapege in otherpages.why the code doesnt work? do i need to add something like is_page() for everypage type to loop? thanks

edit: i discovered the result depends else command so i think wp doesnt think my homepage as home.what do you think?

marked as duplicate by Community Jul 23 at 18:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • ok thank you. problem is solved – ahmet kaya Jul 23 at 17:59

Browse other questions tagged or ask your own question.