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 » Center area post/pages »

How to add PHP to the loop on multi- and single post pages only?


  #1  
Old Jun 16, 2010, 02:24 AM
Fux
 
142 posts · Apr 2009
Hey -

I am using YARPP for realted posts and need to add this

<?php if (function_exists('related_posts')){ ?>
<?php related_posts();?>
<?php }?>

between the bodycontent and the footer. While I could do that in "Style and edit CENTER COLUMN", the related posts will also appear on archive pages, where I don't want them. I put that code between 'bodycopy' and 'pagination' - it works wonderfully if it were not for the archives pages. Is there a way to supress this for specific kinds of pages?
  #2  
Old Jun 16, 2010, 03:44 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
There is a wonderful resourse at http://codex.wordpress.org/Conditional_Tags - if youvisit it you will find there is an is_archive() tag, which you can use the "!" (NOT) with so you could code

HTML Code:
<?php if (function_exists('related_posts')){  
            if (!is_archive()) { related_posts();} } ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jun 16, 2010, 04:55 AM
Fux
 
142 posts · Apr 2009
Thank you, juggledad. Shows I still got a long way to go to learn that PHP stuff. I expected the code in that ("Style and edit CENTER COLUMN") field to be ATA specific.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
php in single post Haser Atahualpa 3 Wordpress theme 3 Dec 4, 2012 07:54 PM
How to add php code to a 'single' page JakeThePeg Center area post/pages 8 Mar 21, 2010 01:21 AM
[SOLVED] Removing Post Headline on Multi and Single Post Pages jen Center area post/pages 2 Jan 8, 2010 07:46 AM
How do I choose between Single Post Pages and Multi Post Pages? BradyKelly Atahualpa 3 Wordpress theme 2 Jan 3, 2010 05:17 AM
BUG: %comments(' ',' ',' ',' ') no longer works in FOOTER of Multi/Single Post(3.3.2) ianuy Post-Kicker, -Byline & -Footer 2 Apr 15, 2009 12:26 AM


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


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