Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Different BG image for landing page/all other pages


  #1  
Old Nov 23, 2010, 11:18 PM
tnandrick
 
43 posts · Nov 2010
Using atahualpa 3.4.9

I found forum postings from Flynn about how to create a landing page template. I have the rough structure up @: http://www.reformationcomic.com/

...and yes, I know; it's non-functional. I need to add a couple form elements and a link to allow entry.

The rest of the site is @: http://www.reformationcomic.com/archives/26

I have a fully scalable bg image inserted right underneath the body with an HTML insert. I would like to have different bg images for the landing page, and the rest of the pages. I have read forums about using body.post-id to use different backgrounds for various parts (header, etc) of a page, but since my bg is an html <img> tag for the entire page instead of a traditional CSS bg image, I don't know if this will work. (Although I might be, and probably am, wrong)

Can I use CSS with the existing Atahualpa structure to do what I want? Or perhaps add $var = x on my landing page template, and $var = y on all other pages, and put...

<?php if ($var == x) {<img src == landing page image>

} else {
<img src == other pages image>
}

?>

...within the body top insert section?

Any help is appreciated, and thanks in advance.

T.
  #2  
Old Nov 24, 2010, 04:04 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
instead of doing it the hard way, why not do it like this http://forum.bytesforall.com/showthread.php?t=6833
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Nov 24, 2010, 10:23 AM
tnandrick
 
43 posts · Nov 2010
Well... (and I'm not trying to be a smart@$$) ...because it's not exactly what I want.

So I will ask a followup:

Is there something within the page I can test against with the if/else? So that in the body top insert section I can do something like:

<?php

$page = page_id; (I don't understand how to extract this info into a $var)

if ($page == *home_page_id*) {
echo "<img src = \"/wp-content/themes/atahualpa/images/*landing_page_bg* \" class = \"bg\" alt = \"background\" />";

} else {
echo "<img src = \"/wp-content/themes/atahualpa/images/*other_page_bg* \" class = \"bg\" alt = \"background\" />";
}

?>

Thanks

Last edited by tnandrick; Nov 24, 2010 at 10:25 AM. Reason: improper coding in example
  #4  
Old Nov 24, 2010, 10:30 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Well you can accomplish most things many ways, You probably want to look at the wordpress codex to see the conditional tags available - http://codex.wordpress.org/Conditional_Tags
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Nov 24, 2010, 01:17 PM
tnandrick
 
43 posts · Nov 2010
I read through the codex about front pages, conditional tags, etc.

However, the code I am using does not work properly.

what I have now (inside html inserts: body top) is:

<?php
if( is_page_template('landingpage.php') ) {
echo '<img src = "/wp-content/themes/atahualpa/images/ReformationSplash.png" class = "bg" alt = "background" />';

} else {
echo '<img src = "/wp-content/themes/atahualpa/images/pulp_paper.jpg" class = "bg" alt = "background" />';

}
?>

I have also tried is_front_page (), and some others that should have worked, including is_page('about') just to try and get it to work. No joy. It will not evaluate the "if" part of the structure as true, no matter what I use.

T
  #6  
Old Nov 29, 2010, 11:13 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try this
HTML Code:
<?php if ( is_home() ) { 
echo '<img src = "/wp-content/themes/atahualpa/images/ReformationSplash.png" class = "bg" alt = "background" />';
} else { 
echo '<img src="/wp-content/themes/atahualpa/images/pulp_paper.jpg" class="bg" alt="background" />'; } ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Dec 8, 2010, 06:37 PM
tnandrick
 
43 posts · Nov 2010
Well almost works... it's at least displaying a different background on:

http://www.reformationcomic/home

but on the page I actually want to use as the landing page:

http://www.reformationcomic/

it still shows the regular background. What's weirder is that when you examine the source for the www.reformationcomic.com page, it says:

<body class="home page page-id-61 page-template page-template-landingpage-php logged-in">

whereas "home" just says:

<body class="blog logged-in">

So somewhere, between WP and Atahualpa, my home page ID is getting mixed up...
  #8  
Old Dec 8, 2010, 08:40 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The blog page is always 'home' if a static page is the landing page, you should test using is_front_page() this is described in the word press doc. Look at dashboard->settings->reading
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Tags
full sized bg image, landing page, post page



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make home (landing page) for pages moaa Atahualpa 3 Wordpress theme 1 Nov 10, 2010 10:47 AM
[SOLVED] Header set to rotate but only does on some pages, not landing page Shells2010 Header configuration & styling 2 Aug 5, 2010 05:17 PM
Multiple Landing Pages At One Time? SCLove Atahualpa 3 Wordpress theme 12 Oct 20, 2009 06:26 AM
How To Use Several Landing Pages SCLove Plugins & Atahualpa 2 Aug 29, 2009 10:46 AM
How to use Landing Page & Blog Together and Problem with "Landing Sites Plugin" SCLove Plugins & Atahualpa 1 Aug 21, 2009 04:37 AM


All times are GMT -6. The time now is 02:18 PM.


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