How do I display the number of views, the number of comments in the loop on the main page?
Good day, I display posts on the main page through the tool - "Posts", how to display the number of views, the number of comments, the acf field, and the rating of the post (I tried to display it through rewie x, but the shortcode does not work, but on this occasion - I communicate with the support of this plugin). After reviewing the code of the Brizy plugin, I not found the file that is responsible for the output of the loop, and it seems to me that the selection is made using a different method than WP_Query. This data I am trying to output here:

-
Hi,
If you want to display the number of comments, you can use the Post Info element https://jmp.sh/2awBtVE or you can add the text element and there add the #Post comments count dynamic tag, see here. Unfortunately, isn't possible to display the number of views. This detail isn't stored in the WordPress posts and therefore can't be displayed.
If you created a Custom Post type and want to display the Custom fields you added through ACF (in a situation when using the Posts element), you have to create for all custom posts a custom taxonomy and after this add this custom taxonomy to all custom posts. After this, in the Posts element, you have to select this custom taxonomy to display all these custom posts https://jmp.sh/lbLAj7A. Next, inside the Posts element, you can add the text element and add the # symbol and after this select from the dropdown the custom field, see here https://jmp.sh/OPAjwgQ.
Let us know if we can help you with something else.
Best regards,
Sandra0
Please sign in to leave a comment.
Comments
1 comment