Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   [SOLVED] Confused about how to insert Cforms Tell-a-Friend on a single post page (http://forum.bytesforall.com/showthread.php?t=3624)

alymid Sep 27, 2009 05:10 PM

[SOLVED] Confused about how to insert Cforms Tell-a-Friend on a single post page
 
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?

juggledad Sep 28, 2009 09:56 AM

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 -->


alymid Sep 28, 2009 12:15 PM

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

alymid Sep 28, 2009 01:48 PM

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.

juggledad Sep 28, 2009 02:23 PM

oops, I forgot the '<?php' and the closing '</div> - I fixed the code in post #2

alymid Sep 28, 2009 08:13 PM

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.

juggledad Sep 29, 2009 04:06 AM

ah s$#@...sorry I left out the closing'}' - code fixed in post #2....again...sigh

alymid Sep 29, 2009 08:10 AM

AWESOME!! this worked - thank you so much!

alymid Sep 29, 2009 08:16 AM

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(#); } ?>



All times are GMT -6. The time now is 06:52 AM.

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