php - How to remove breadcrumbs if “home” in wordpress static front page -


i found 1 remove breadcrumbs if "home" in wordpress sadly not working me

<body<?php if(! is_home()) echo ' id="homepage"';?>> 

in header.php

body#homepage#breadcrumbs {visibility: hidden;} 

and added in style.css

first change css this. because breadcrumb trail uses class of breadcrumbs , not id.

body#homepage .breadcrumbs 

have tried using is_frontpage() instead of is_home() ? realize @ moment adding homepage id pages not "home" page? don't use ! in if.

<body<?php if(is_frontpage()) echo ' id="homepage"';?>> 
  • blog postspage = frontpage

    on site front page:

    • is_front_page() return true
    • is_home() return true
  • static page = frontpage
    • on page assigned display site front page:
      • is_front_page() return true
      • is_home() return false
    • on page assigned display blog posts index:
      • is_front_page() return false
      • is_home() return true

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -