How to include <?php echo esc_html($product->get_review_count()); ?> in function.php?

152
March 27, 2019, at 5:50 PM

I'd like to add :<?php echo esc_html($product->get_review_count()); ?> in my function which is :

function commentaires() {
    print '<p class="commentaires" Id="liste-des_commentaires">Commentaires</p>';
}

How can I write that properly ?

To explain, I want to display next to my word "Commentaires", the number of comments.

Thanks for your help !

Answer 1

If number of comments in $product->get_review_count(), than:

function commentaires($count) {
    print '<p class="commentaires" Id="liste-des_commentaires">Commentaires '.$count.'</p>';
}
commentaires($product->get_review_count());
Rent Charter Buses Company
READ ALSO
Can i set password for already generated pdf file using mpdf or any other php pdf libraries

Can i set password for already generated pdf file using mpdf or any other php pdf libraries

I need to set password for my already generated pdf file using mpdf in php

155
How to change last modified date for file on my Minio storage using Laravel S3 driver?

How to change last modified date for file on my Minio storage using Laravel S3 driver?

I am storing uploaded files on my Minio storage using Laravel S3 driverProblem is that all files have a current timestamp as their "Last modified" date

334
MQTT using HiveMQ into IIS

MQTT using HiveMQ into IIS

Window server 2008 php 7+

193