Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] Display %image only on Homepage/Frontpage (http://forum.bytesforall.com/showthread.php?t=9628)

semperfidelis Sep 13, 2010 06:11 PM

[SOLVED] Display %image only on Homepage/Frontpage
 
Hello!

Is it possible to display the %image (header image) only on the homepage/frontpage of a website? I've been thinking about a css insert, like
Code:

.home #menu2 {display:none;}
...but somehow i'm stuck.

Perhaps it's even possible to "connect" different headers to different page id's?

Sorry for all the trouble, I'm greatful for any advice!

Cheers


As always: i'm sorry for my poor English

lmilesw Sep 14, 2010 03:07 PM

You can use conditional for that If you only want to display header images on the home page you would use the following in ATO>Style & edit Header Area>Configure Header Area
HTML Code:

<?php if( is_home() ) { ?>
%image
<?php } ?> 

To display different images to different pages one way is to use another conditional for the page id as such
HTML Code:

<?php if( is_page('33') ) { ?>
<img src="http://path_to_image.jpg" />
<?php } ?> 

where the number in the parentheses is the id of the page in question.

semperfidelis Sep 15, 2010 07:19 PM

This is simply great!
Thanks a lot!

bender57 Jan 4, 2011 08:16 AM

Hi!

I am annoyed as the code does not work with my configuration: :confused: (it only works on the BLOG page...)

PHP Code:

<?php if( is_home() ) { ?> 
%image
<?php ?>


My wordpress config:

Static Page (in Reading)


What I want to do:

Show %image ONLY on frontpage.

Can someone help me to solve my issue?

juggledad Jan 4, 2011 10:16 AM

the 'home' page in wordpress terminology refers to the 'blog' page no matter where it is. the landing page is called the 'front' page so you need to test for the front page instead of the home page.

Check out http://codex.wordpress.org/Conditional_Tags for the correct syntax

mk11sandiego Dec 14, 2011 11:03 PM

I have a static front page and have inserted the following code in "configure header area" but still doesn't work.

<?php if( is_front_page() ) { ?>
%image
<?php } ?>

the rotating images still appear on every page, but i only want that on the front page only..

Do you have any idea??

juggledad Dec 15, 2011 04:32 AM

You can't use php in the options anymore due to WordPress restrictions. Try adding this to your CSS Inserts
HTML Code:

body.home #imagecontainer {display:none;}

mk11sandiego Dec 22, 2011 09:46 PM

Thank youuuuu!


All times are GMT -6. The time now is 05:24 AM.

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