Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Forum How-To (http://forum.bytesforall.com/forumdisplay.php?f=9)
-   -   How to Remove HTML Insert from One Page Only? (http://forum.bytesforall.com/showthread.php?t=9861)

eric41 Sep 24, 2010 10:55 AM

How to Remove HTML Insert from One Page Only?
 
Hi. I have the following code at ATO>HTML/CSS Inserts>Body Top:

Code:

<div style="text-align:center; width:1119px; margin-left:auto; margin-right:auto;">
<img id="Image-Maps_3201009240908334" src="http://www.tjicco.org/wp/wp-content/uploads/2010/09/Just-Header.jpg" usemap="#Image-Maps_3201009240908334" style="border: 0; padding: 0;" border="0" width="1119" height="155" alt="" />
<map id="_Image-Maps_3201009240908334" name="Image-Maps_3201009240908334">
<area shape="rect" coords="139,106,196,128" href="http://www.tjicco.org/wp" alt="" title=""    />
<area shape="rect" coords="230,107,311,129" href="http://www.tjicco.org/wp/about-us" alt="" title=""    />
<area shape="rect" coords="349,107,424,129" href="http://www.tjicco.org/wp/news" alt="" title=""    />
<area shape="rect" coords="459,107,548,129" href="http://www.tjicco.org/wp/donate" alt="" title=""    />
<area shape="rect" coords="586,107,688,129" href="http://www.tjicco.org/wp/volunteer" alt="" title=""    />
<area shape="rect" coords="729,107,852,129" href="http://www.tjicco.org/wp/photo-gallery" alt="" title=""    />
<area shape="rect" coords="889,107,971,129" href="http://www.tjicco.org/wp/contact" alt="" title=""    />
</map>
</div>

...but I want this image map to NOT appear on the home page, whose page id is 6. What do I add to CSS Inserts to remove it from the home page ONLY? I am using Atahualpa346 and WP 3.0

Thank you.

lmilesw Sep 24, 2010 03:29 PM

I haven't tested but you could give this a shot. It is saying to use that code when not on the home page. Let me know if it works.

HTML Code:

<?php if( !is_home() ) { ?>
<div style="text-align:center; width:1119px; margin-left:auto; margin-right:auto;">
<img id="Image-Maps_3201009240908334" src="http://www.tjicco.org/wp/wp-content/uploads/2010/09/Just-Header.jpg" usemap="#Image-Maps_3201009240908334" style="border: 0; padding: 0;" border="0" width="1119" height="155" alt="" />
<map id="_Image-Maps_3201009240908334" name="Image-Maps_3201009240908334">
<area shape="rect" coords="139,106,196,128" href="http://www.tjicco.org/wp" alt="" title=""    />
<area shape="rect" coords="230,107,311,129" href="http://www.tjicco.org/wp/about-us" alt="" title=""    />
<area shape="rect" coords="349,107,424,129" href="http://www.tjicco.org/wp/news" alt="" title=""    />
<area shape="rect" coords="459,107,548,129" href="http://www.tjicco.org/wp/donate" alt="" title=""    />
<area shape="rect" coords="586,107,688,129" href="http://www.tjicco.org/wp/volunteer" alt="" title=""    />
<area shape="rect" coords="729,107,852,129" href="http://www.tjicco.org/wp/photo-gallery" alt="" title=""    />
<area shape="rect" coords="889,107,971,129" href="http://www.tjicco.org/wp/contact" alt="" title=""    />
</map>
</div>
<?php } ?>


eric41 Sep 24, 2010 04:07 PM

Would I just tack that on to the end of header.php? If so, I tried that and no cigar. Actually, it seemed to have the reverse effect, where the image map appeared only on the home page instead of removing it from the home page. Any other thoughts? Thanks again.

p.s. Would it help or make any difference to know that I have set Home as the static front page of the site?

lmilesw Sep 24, 2010 07:44 PM

I was thinking of putting in ATO>Add HTML/CSS Inserts>CSS Inserts

eric41 Sep 25, 2010 02:30 AM

Sorry to say this didn't do the trick. When I put your code at CSS Inserts, it did in fact remove the image map from the home page, but now it's not appearing anywhere else either! How do I make it appear on every page EXCEPT the home page? Thanks for working on this!

juggledad Sep 25, 2010 04:45 AM

Add an ID to the div like: <div id="one_page">....</div>
then in the CSS Inserts use a
HTML Code:

body #one_page {display:none;}
body.page-id-xx #one_page {display: block;}

where 'xx' is the id of the page you want it on

eric41 Sep 25, 2010 06:00 AM

Juggledad, thank you very much for your reply. I placed an id in the div so that it looks like this:

Code:

<div id="tjicco_header" style="text-align:center; width:1119px; margin-left:auto; margin-right:auto;"
<img id="Image-Maps_3201009240908334" src="http://www.tjicco.org/wp/wp-content/uploads/2010/09/Just-Header.jpg" usemap="#Image-Maps_3201009240908334" style="border: 0; padding: 0;" border="0" width="1119" height="155" alt="" />
<map id="_Image-Maps_3201009240908334" name="Image-Maps_3201009240908334">
<area shape="rect" coords="139,106,196,128" href="http://www.tjicco.org/wp" alt="" title=""    />
<area shape="rect" coords="230,107,311,129" href="http://www.tjicco.org/wp/about-us" alt="" title=""    />
<area shape="rect" coords="349,107,424,129" href="http://www.tjicco.org/wp/news" alt="" title=""    />
<area shape="rect" coords="459,107,548,129" href="http://www.tjicco.org/wp/donate" alt="" title=""    />
<area shape="rect" coords="586,107,688,129" href="http://www.tjicco.org/wp/volunteer" alt="" title=""    />
<area shape="rect" coords="729,107,852,129" href="http://www.tjicco.org/wp/photo-gallery" alt="" title=""    />
<area shape="rect" coords="889,107,971,129" href="http://www.tjicco.org/wp/contact" alt="" title=""    />
</map>
</div>


I then placed your two lines of code at CSS Inserts with the page id, like this:

Code:

body #tjicco_header {display:none;}
body.page-id-6 #tjicco_header {display: block;}

It took it off the home page (id=6) alright, but it also took it off of all other pages. Did I put it all in right?

juggledad Sep 25, 2010 06:27 AM

sorry, I read teh post wrong, If you just want is gone on the home age use eithor
HTML Code:

body.home #tjicco_header {display:none;}
or
HTML Code:

body.page-id-6 #tjicco_header {display: none;}
and leave out the
HTML Code:

body #tjicco_header {display:none;}

eric41 Sep 25, 2010 07:23 AM

Yep, that did it! And it's two birds with one stone because I've found the first info you gave for making it appear on one page only, useful as well. Thanks so much for taking the time! Please know that I will be leaving a donation asap..it's just that I am living in Germany right now, where I have not found work, so I am supporting myself with website creation. So right now I am having to rely on your guys' good graces, but a donation is forthcoming..goodness knows the help you guys provide is worth it!

Thanks again to you both!

Eric

lmilesw Sep 25, 2010 07:25 AM

Quote:

Originally Posted by eric41 (Post 44454)
Sorry to say this didn't do the trick. When I put your code at CSS Inserts, it did in fact remove the image map from the home page, but now it's not appearing anywhere else either! How do I make it appear on every page EXCEPT the home page? Thanks for working on this!

It must have been late when I said to put this in CSS Inserts. I meant to put it in ATO>HTML/CSS Inserts>Body Top. Of course Juggledad's solution should work as well.


All times are GMT -6. The time now is 11:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.