$(function(){
if (window.location.pathname == "meusite/url1php"||window.location.pathname == "meusite/diretorio/url2.html"||window.location.pathname == "url3.html") {
$('#umadiv').hide();
} else {
$('#umadiv').show();
}
});
No script
You can also define a class in the <body>
element indicating the current page. So if you're on the index page, <body class='index'>
you can use CSS to hide specific elements.
body.index #umadiv { display: none; }
Example:
body.index #umadiv { display: none; };
<body class='index'>
<div id="umadiv">
kkkkkkk
</div>
Conteudo da pagina
</body>
You can also use the following scheme:
index.php
<php
$pagina="index";
.......
include_once "header.php";
.......
page1.php
<php
$pagina="pagina1";
.......
include_once "header.php";
.......
page2.php
<php
$pagina="pagina2";
.......
include_once "header.php";
.......
etc .....
header.php
$ocultar = array("index", "pagina1", "pagina2");
if (!in_array($pagina, $ocultar)) {
//a div aqui
}