Add "customer field" after 1st post on multi post page
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) : ?> 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 |
try adding an OR to your IF and check for the front page
|
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! |
what code did you try? display it here and maybe I can see the error you made.
|
Thanks! juggledad
I am not familiar with the php code and following is my code: Code:
<?php is_front_page(); ?> |
You might want to read up on 'conditionals - http://www.w3schools.com/php/php_operators.asp
|
did you mean:
Code:
<?php is_front_page(); ?> && <?php if ($wp_query->current_post == 0 ) : ?>www.bonjour-travel.com<?php endif; ?> Thanks! |
try this
HTML Code:
<?php (is_front_page() && ($wp_query->current_post == 0 )) : ?>www.bonjour-travel.com<?php endif; ?> |
All times are GMT -6. The time now is 09:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.