Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

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, 05: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, 09:56 AM
juggledad's Avatar
juggledad
 
23,632 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 04:05 AM.
  #3  
Old Sep 28, 2009, 12: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, 01: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, 02:23 PM
juggledad's Avatar
juggledad
 
23,632 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, 08: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, 04:06 AM
juggledad's Avatar
juggledad
 
23,632 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, 08:10 AM
alymid
 
6 posts · Sep 2009
AWESOME!! this worked - thank you so much!
  #9  
Old Sep 29, 2009, 08: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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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 05:14 PM
Adding signature under single post, not on frontpage /multiple-post page AnneTanne Post-Kicker, -Byline & -Footer 0 Aug 19, 2009 02:16 PM
Archive page shows post box help, and single post on front page help boberang Atahualpa 3 Wordpress theme 0 Aug 7, 2009 09: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 02:58 PM
How to select the page for cForms dpdoug Plugins & Atahualpa 2 Jun 9, 2009 08:22 AM


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


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