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?

Old Jun 16, 2010, 03:24 AM
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?
Old Jun 16, 2010, 04:44 AM
juggledad's Avatar
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
Old Jun 16, 2010, 05:55 AM
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
php in single post Haser Atahualpa 3 Wordpress theme 3 Dec 4, 2012 08:54 PM
How to add php code to a 'single' page JakeThePeg Center area post/pages 8 Mar 21, 2010 02:21 AM
[SOLVED] Removing Post Headline on Multi and Single Post Pages jen Center area post/pages 2 Jan 8, 2010 08:46 AM
How do I choose between Single Post Pages and Multi Post Pages? BradyKelly Atahualpa 3 Wordpress theme 2 Jan 3, 2010 06: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 01:26 AM

All times are GMT -6. The time now is 01:24 PM.

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