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

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.

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.