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 »

Add "customer field" after 1st post on multi post page


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 Nov 26, 2011, 02:54 AM
fantasy
 
4 posts · Nov 2011
Hi all,
I wants to add some customer text (ex: advertisement code or URL or text) between 1st post and 2nd post on multi post page.(I want this text "only" display after 1st port, not display on 2nd, 3rd....etc posts).

I add the following code in the index.php file.
Code:
<?php if ($wp_query->current_post == 0) : ?>
www.bonjour-travel.com
<?php endif; ?>
After I added this code, I can see this text displayed correctly(you can see it only display after 1st post, ex: www.bonjour-travel.com), but if I enter any post (single post page), this txt also displayed after the article (you can refer to : http://www.bonjour-travel.com/archives/2096) , but I just want this text only displayed on my first page (multi-post page), and don't displayed on single page
Any one knows how to modify the code? Thanks in advance!

My homepage: www.bonjour-travel.com
Atahualpa: 3.7.3
Wordpress: 3.2.1
  #2  
Old Nov 26, 2011, 04:56 AM
juggledad's Avatar
juggledad
 
22,269 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
try adding an OR to your IF and check for the front page
__________________
"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 26, 2011, 07:21 AM
fantasy
 
4 posts · Nov 2011
Thanks for the reply but I still can not get it works.
Is nay one can help to point out how to modify the code?
Thanks!
  #4  
Old Nov 26, 2011, 07:35 AM
juggledad's Avatar
juggledad
 
22,269 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
what code did you try? display it here and maybe I can see the error you made.
__________________
"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 28, 2011, 07:08 AM
fantasy
 
4 posts · Nov 2011
Thanks! juggledad
I am not familiar with the php code and following is my code:

Code:
<?php is_front_page(); ?>
<?php if ($wp_query->current_post == 0 ) : ?>www.bonjour-travel.com<?php endif; ?>
  #6  
Old Nov 28, 2011, 08:00 AM
juggledad's Avatar
juggledad
 
22,269 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
You might want to read up on 'conditionals - http://www.w3schools.com/php/php_operators.asp
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Nov 28, 2011, 08:45 AM
fantasy
 
4 posts · Nov 2011
did you mean:
Code:
<?php is_front_page(); ?> && <?php if ($wp_query->current_post == 0 ) : ?>www.bonjour-travel.com<?php endif; ?>
But it still can not works for me,
Thanks!
  #8  
Old Nov 28, 2011, 10:33 AM
juggledad's Avatar
juggledad
 
22,269 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
try this
HTML Code:
<?php (is_front_page() && ($wp_query->current_post == 0 )) : ?>www.bonjour-travel.com<?php endif; ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integration of "WP Post to PDF" similar to "WP Print" or "WP Mail" neckit Plugins & Atahualpa 4 May 30, 2011 07:44 AM
[SOLVED] Substitute Post name with &quot;Next Post&quot; and &quot;Previous Page&quot; in post navigation Alternateroute Center area post/pages 2 Nov 18, 2010 08:15 PM
How to select "Only Exerpts"/"Full Posts" for certain post? shus Center area post/pages 4 Jan 19, 2010 01:41 PM
[SOLVED] How to exclude posts in a category from appearing on the &quot;blog&quot;/multi-post p Shepherd Jim Atahualpa 3 Wordpress theme 6 Sep 18, 2009 02:04 PM
How to style "post icon" and "post comments" text Whatsthatcat? RSS, Feeds & Subscribing 3 Apr 1, 2009 09:41 AM


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


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