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 » Plugins & Atahualpa »

[SOLVED] Confused about how to insert Cforms Tell-a-Friend on a single post page


  #1  
Old Sep 27, 2009, 06:10 PM
alymid
 
6 posts · Sep 2009
We've been using Cforms for a while on our group blog. Recently we changed over to Atahualpa. We use the Tell-a-Friend function to allow people to nominate posts for awards that we give out.

We only want the TAF form to show on the single post pages, under the comments.
The Cforms instructions for that are:

Code:
Simply add a <?php insert_cform(#); ?> (# = your form id) to your existing single.php and/or page.php template, e.g:
[...]
<?php the_content('<p>Read the rest of this entry »</p>'); ?>
<?php if ( is_tellafriend( $post->ID ) ) insert_cform(#); ?>
[...]
And while i am generally fairly decent at figuring out how to do this, where it goes in this theme is mystifying me a bit. Any ideas of where to insert this?
  #2  
Old Sep 28, 2009, 10:56 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what version of Atahualpa, WP, PHP?
What is the url?

Try replacing the last line of 'The LOOP' (ATO->Style & edit CENTER COLUMN)
HTML Code:
</div><!-- / Post -->
with
HTML Code:
<?php if (is_single()) {
    the_content('<p>Read the rest of this entry »</p>'); 
    if ( is_tellafriend( $post->ID ) ) insert_cform(#); } ?>
</div><!-- / Post -->
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Sep 29, 2009 at 05:05 AM.
  #3  
Old Sep 28, 2009, 01:15 PM
alymid
 
6 posts · Sep 2009
thanks for the suggestion!! I'll give that a try right away - but to answer your questions:

WordPress Version 2.8.4
Atahualpa 3.4.1 (will probably upgrade to new one before I make the suggested edits though)
PHP5
http://seasonsoflace.com
  #4  
Old Sep 28, 2009, 02:48 PM
alymid
 
6 posts · Sep 2009
putting it there gets it after every post on the front page. But we don't want it to display on the front page, just on the single post pages.
  #5  
Old Sep 28, 2009, 03:23 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
oops, I forgot the '<?php' and the closing '</div> - I fixed the code in post #2
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Sep 28, 2009, 09:13 PM
alymid
 
6 posts · Sep 2009
okay that got me a whole string of this error on the main page and a single on the single page

Code:
Parse error: syntax error, unexpected ';', expecting ')' in /home/seasons/public_html/wp-content/themes/atahualpa/functions.php(478) : eval()'d code on line 25
And not that it really matters but I am pretty sure the
Code:
<?php the_content('<p>Read the rest of this entry »</p>'); ?>
part of that sample code was window dressing and not important to the implementation at all.
  #7  
Old Sep 29, 2009, 05:06 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
ah s$#@...sorry I left out the closing'}' - code fixed in post #2....again...sigh
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old Sep 29, 2009, 09:10 AM
alymid
 
6 posts · Sep 2009
AWESOME!! this worked - thank you so much!
  #9  
Old Sep 29, 2009, 09:16 AM
alymid
 
6 posts · Sep 2009
As a note - I actually ended up moving it down to the " Content below the loop" section - just after line about loading the comments template -

Doing that gets the form to display below the comments which is where our folks are used to seeing it. I deleted the extra line, because when moved below the loop it made the post print on the page twice.

So the final code line was :

Code:
<?php if (is_single()) {
    if ( is_tellafriend( $post->ID ) ) insert_cform(#); } ?>

Bookmarks

Tags
cforms, code insertion, php



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Dashed Line Above 1st Post on Single Post Page krystyna Post-Kicker, -Byline & -Footer 2 Aug 27, 2009 06:14 PM
Adding signature under single post, not on frontpage /multiple-post page AnneTanne Post-Kicker, -Byline & -Footer 0 Aug 19, 2009 03:16 PM
Archive page shows post box help, and single post on front page help boberang Atahualpa 3 Wordpress theme 0 Aug 7, 2009 10:26 AM
[SOLVED] Next post and previous post links on top of single post page error susieswe Atahualpa 3 Wordpress theme 2 Jul 15, 2009 03:58 PM
How to select the page for cForms dpdoug Plugins & Atahualpa 2 Jun 9, 2009 09:22 AM


All times are GMT -6. The time now is 11:31 AM.


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