form count display

By: Randy Murray | Asked: 11/16/2023
ForumsCategory: General questionsform count display
Randy Murray asked 1 year ago
Randy Murray replied 1 year ago

It seems like a simple thing to do but I am having trouble. How do I auto count the total number entries submitted via a form and then display that total on a home page? example is 10 forms submitted and the total shows in a defined section on the home page. thanks

Rob LeVineRob LeVine replied 1 year ago

You can create a custom shortcode like the following:
add_shortcode('entry-count','my_entry_count');
function my_entry_count($atts){
$entries = FrmEntry::getAll(array('it.form_id' => X)); // replace X with your form id
return count($entries);
}

Victor Font replied 1 year ago

You can also use FrmEntry::getRecordCount("fr.id = '84'"). Replace the '84' with your form id.

Randy Murray replied 1 year ago

Thank you both. Got it.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right