Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] Picture In the loop


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Jul 5, 2012, 05:02 AM
Björn Palovaara's Avatar
Björn Palovaara
 
12 posts · Apr 2010
Hi

In older version of Atahualpa I had a code "in the loop" for a picture on the frontpage only. I upgraded to latest version of Atahualpa and then "in the loop" disappeard. I found the index.php file and changed the code. But now this picture is shown on all pages and posts.

I want this picture only to be shown at frontpage. I can't solve it and did not save the code from the old version.

Thanks in advance!!
  #2  
Old Jul 5, 2012, 05:50 AM
juggledad's Avatar
juggledad
 
20,151 posts · Mar 2009
OSX 10.6.8/10.7.3 WP 2.8.x/2.9.x/3.x Atahualpa 3.5.x/3.7.x Safari 5.x Firefox 11 XP
you should add a php 'if' arround the code, something like
HTML Code:
<?php if (is_front_page()) {your image code here }; ?>
  #3  
Old Jul 9, 2012, 02:07 AM
Björn Palovaara's Avatar
Björn Palovaara
 
12 posts · Apr 2010
Hi - I don't have the php knowledge, just a barely visible scratch on the surface, if using a microscope. You see - I don't get this one right, startpage error.
I simply can't merge them two codes together, even if it looks very simple - I have tried many different ways of putting the code, this one is the latest not working code:

HTML Code:
<?php if (is_front_page()) {<img src="http://www.website.se/amazing.jpg" width="555" height="20" /> }; ?>
What is wrong?

Last edited by juggledad; Jul 9, 2012 at 02:59 AM.
  #4  
Old Jul 9, 2012, 03:06 AM
juggledad's Avatar
juggledad
 
20,151 posts · Mar 2009
OSX 10.6.8/10.7.3 WP 2.8.x/2.9.x/3.x Atahualpa 3.5.x/3.7.x Safari 5.x Firefox 11 XP
when dealing with php and HTML you can't 'mix' the two, you have to let the browser know when you are 'talking' PHP and when you are talking HTML. That is why you see the '<?php' and ?>'. The '<?php' says that this is the start of some php code and the '?>' says that the php is over and now we are doing HTML, so it can get confusing if you don't know what you are doing. Here is how your line should be coded.
HTML Code:
<?php if (is_front_page()) {?> <img src="http://www.website.se/amazing.jpg" width="555" height="20" /> <?php }; ?>
  #5  
Old Jul 9, 2012, 03:44 AM
Björn Palovaara's Avatar
Björn Palovaara
 
12 posts · Apr 2010
Ahaa! Now I got it, and it is working. Many many thanks!

The best!

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Loop to "Below the Loop" stumpadelic Center area post/pages 0 Apr 28, 2011 12:23 PM
How to put picture into Byline? AJHackett Post-Kicker, -Byline & -Footer 10 Mar 7, 2011 04:07 AM
[SOLVED] How to Eliminate Previous-Next Box Between Before-Loop and Loop? LaneLester Center area post/pages 0 Nov 10, 2010 09:03 AM
Hi, new and need help with heading and picture..... droopal Installing & running WordPress 10 Apr 13, 2010 05:21 AM
picture in posts zizi Header configuration & styling 4 Apr 6, 2009 08:23 PM


All times are GMT -6. The time now is 04:12 AM.


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