[post-views]
is a feature of https://wordpress.org/plugins/post-views-counter/ — it has nothing to do with Pods.
Regardless, you can see in wp-content/plugins/post-views-counter/includes/class-frontend.php
line 44 that the shortcode uses get_the_ID()
. Therefore, you need to call the shortcode within a WP_Query loop. See https://codex.wordpress.org/The_Loop for a detailed description of what that means.
If I use a loop then it messes up the page.
Then you’re not using the loop correctly. Don’t set up a new loop; use the main loop for the taxonomy page.
See https://stackoverflow.com/a/34157111
See https://www.smashingmagazine.com/2014/08/customizing-wordpress-archives-categories-terms-taxonomies/
actually i dont want to use loop, because i dont need display more posts. As you can see my code above, i just want to use this only.
This is my Custom taxonomy https://ibb.co/1LMqJZN
-
This reply was modified 2 years, 3 months ago by
Xaib Aslam.
The shortcode you’re calling requires a loop in order for the post object to be defined. It does not work for views of an archive listing. Take it up in the forum of that plugin, not Pods.
i have no idea that what code i have to add.. i do lots of search but cant find the answer.
You’re using a plugin called “post views”. It counts views of a post. A taxonomy is not a post. Search for a plugin that will count views on a taxonomy archive.
ok, and is there any function code for that ?
Also want to know that is there any solution for that ?
And see https://developers.google.com/analytics/devguides/reporting/core/v4
You generally don’t want to record stats onto your database on front end views. It will be full of spam and make things go slow or crash. Outsource the stat recording to an analytics suite such as GA and use an API to display the result.
i am using this plugin,
https://wordpress.org/plugins/post-views-counter/
i talk with them also and they said that we dont have option for archive page.
Yes, I know.
I linked to that plugin in my first response and read the code for you.
Now it’s your turn: read the forum post and Google Analytics docs. There are two possible solutions with example code for each. Doing it in your own database will likely crash things. Doing it with Google Analytics will be more reliable.
I’ve given you everything you need to write a solution. Now please stop spamming the Pods forum with unrelated custom requirements.
i am sorry for this, i really appreciate your help.
i have a question here, you custom fields but cant find checkbox system. I saw that there is only YES and NO option for checkbox. What if i want multiple check-boxes?
Use a relationship field > simple relationship.
thanks, got it. and what about if empty field then we can hide them.
-
This reply was modified 2 years, 3 months ago by
Xaib Aslam.