954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Wordpress Counter

I've looked extensively for an answer to this but have gotten nowhere. Here’s what I’m trying to do:

I’m having people submit a form on my Wordpress site telling me their pledges for a volunteer campaign. When they submit their volunteer project I want to have a counter track the number of volunteers based on how many form submissions there are. I don't want that number submitted with the form, I’d like to have a counter at the top of my site that says, “_#_ Volunteers!”.

I'm using the Contact Form 7 plugin as well as the Contact Form 7 - Dynamic Text Extension Plugin. I've found a tutorial here to count the submissions but I'm at a loss as to how to get the number to post as a counter on my site.

Any ideas How I can do that? Thanks!

FcVolunteer

fcvolunteer
Newbie Poster
22 posts since Mar 2011
Reputation Points: 12
Solved Threads: 1
 

Have you confirmed whether the counter value in the database is being incremented? I don't mean to tell you something you might already know, but check the wp_options table, and search by option_name for cf7-counter.

If the value is being incremented, that means you've set up the action correctly. Then from the tutorial, it looks as though a shortcode is being used to output the count. If the shortcode tag is included in the main content field of your post/page, it should be applied automatically by the filter, the_content.

If however you want to render it in the header of your site, you'll probably have to use:

echo do_shortcode('[CF7_counter]');


R.

blocblue
Posting Pro in Training
475 posts since Jan 2008
Reputation Points: 142
Solved Threads: 79
 

The author of the tutorial answered me with this: Yup, that’d be easy. The value is already stored in the DB. So you’d just do this:

<?php echo get_option( CF7_COUNTER, 0); ?> Volunteers!


You could also use the shortcode

[CF7_counter]

Thanks!

fcvolunteer
Newbie Poster
22 posts since Mar 2011
Reputation Points: 12
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: