Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
displaying number of replies in topic from forum via Blog Post Linking plugin?
Avatar
Jeroen den haan
Member
Free Members
sp_UserOfflineSmall Offline
May 13, 2013 - 6:28 am

Hi there,

I'd like to display the number of replies in a forum topic that was posted via the Blog Post Linking plugin a la "Mac rumors" homepage. So on my homepage I display a post that also created a forum topic. A number of people reply to this topic. On the homepage (the posts list) I want to see how many people are participating in this discussion.

Is that possible?

Thnx in advance

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 13, 2013 - 7:25 am

If you look at the Codex page for the plugin (http://codex.simple-press.com/.....g-linking/) you will see a template tag that is available called;

spCommentsNumberTag()

Will that do what you want?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jeroen den haan
Member
Free Members
sp_UserOfflineSmall Offline
May 13, 2013 - 3:17 pm

That might be it, but where do i put this for example in the basic twentytwelve? I just tried putting it in the content.php file, but that caused an error and stopped it from displaying anything.

I do not completely understand how and what to put in my template. this?

<?php spCommentsNumberTag('0','Comments','Comment','Comments','1'); ?>

?

 

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 13, 2013 - 6:44 pm

you put in your template file where you want the comment count to appear...

but Andy gave you syntax assuming it was going in an html section... if php is already active, you would just enter:

spCommentsNumberTag('0','Comments','Comment','Comments','1');

be sure to copy raw code so you dont get dorked up quotes... same if php is not active and you use Andy's code...

if you get error, please post it here...

Avatar
Jeroen den haan
Member
Free Members
sp_UserOfflineSmall Offline
May 14, 2013 - 3:36 am

I tried putting it in content.php of the twenty twelve template. in this piece of the file:

<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif;
spCommentsNumberTag('0','Comments','Comment','Comments','1');
?>

I get this error:

Fatal error: Call to undefined function spCommentsNumberTag()

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 14, 2013 - 10:49 am

argh... sorry, didnt realize that is the wrong function to call...  its not publicly available... need to call the wrapper which should be...

spCommentsNumber();

give that a try...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625