Questions tagged [views]
The views tag has no usage guidance.
92
questions
0
votes
0
answers
14
views
All views within a time range [closed]
I use wordpress with wordpress-popular-posts (wpp). I need the total number of views within a range of 24 hours, a week, a month back. Obviously there is only a solution for one id. But i need all ...
0
votes
1
answer
73
views
hide "Open in New Tab" checkbox in link field
I added a custom field to a repeater with PHP:
[
'key' => 'field_sponsor_badge_url',
'name' => 'url',
'label' => 'URL',
'type' => '...
0
votes
0
answers
25
views
Count the total views of all user posts published
I have 1 essential questions
I want to count the total views of all posts published by a user (login user).
for example show:
total view of your all posts: 485
Is there a way to do this?
Can you help ...
0
votes
0
answers
111
views
Best way to fix bad count on All | Mine | Published
I tweaked the default behavior of the post listing page (for a custom post type) via pre_get_posts, the thing is that now the count of All | Mine | Published isn't the right one.
I'm aware there is ...
0
votes
0
answers
59
views
Why "Mine" is the default view when adding 'capability_type' in register_post_type
I'm tweaking default's wordpress permissions by adding my own via the capability_type and map_meta_cap in register_post_type(), but I noticed that as soon I add the capability_type argument, the ...
0
votes
1
answer
797
views
Display a list of users who have viewed the post you are viewing
How would I display a list of users who have viewed the post you are viewing?
0
votes
1
answer
23
views
How to unlink all posts from tracking same amount of views
I'm trying to show the top 5 most popular ( most viewed ) blogs. It is working as it should and then I added a script in the functions.php to display the views just while I build this so I can see it'...
1
vote
1
answer
414
views
How to show post views on single.php page?
how to show post views on single.php?
What I tried:
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
...
1
vote
1
answer
913
views
How to display post view count by date, week and month?
I am using the below code to display post views. How can I get the data for every day, week and month?
function gt_get_post_view() {
$count = get_post_meta( get_the_ID(), 'post_views_count', true ...
0
votes
1
answer
84
views
restrict incrementation of post vies count when refreshing the page
I use a post views counter to save post views -
function calculatePostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
...
0
votes
0
answers
167
views
How to show post views shortcode data for each post on Posts List Page?
Example: [shortcode id=""].
I just want to how to dynamically fetch each post ID on Posts Lists page over archive page or normal posts page inside the shortcode placed in excerpt.
Currently I'm using ...
-2
votes
1
answer
2k
views
How to make Fake Views on Wordpress
I dont know how to code and sorry for my bad english, so i found a code here to make a random views on my post views using $count = rand(700,999); which make a random views for my post but the problem ...
-1
votes
1
answer
194
views
Get users query makes the site loading time too big?
I'm trying to get the top 10 users in (specific roles) by the highest post views, but this code makes the site loading time too big, and I don't know why!
I'm highly appreciated your help.
<?php ...
0
votes
1
answer
100
views
How can i show post views using specified post ID?
Here is the code...
if ( !function_exists( 'getCrunchifyPostViews' ) ) {
function getCrunchifyPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, ...
1
vote
1
answer
118
views
Create a list-style post of popular posts for the week?
I've been looking for something that would automate the creation of a popular posts of the week blog post. So for instance, every Monday create post that is a list of the most popular posts from the ...
1
vote
1
answer
1k
views
Get .subsubsub count of post per status queried using pre_get_posts
My following query using pre_get_posts shows the Author only certain posts or pages with certain statuses that s/he should only see and of what belongs to him/her.
Is there any way I can get a count ...
0
votes
2
answers
719
views
Count category views - Is it possible?
I would like to show my most viewed categories (kind like the "WP-PostViews" plugin).
I already did some research but I didn't find nothing about that. This made me think that it can't be done by ...
0
votes
1
answer
33
views
How to fix blog article view and share #'s?
This is about public views on the front-end of our blog.
All newly published articles view counter & share #'s have stopped updating.
So, if someone views the article or shares it on social ...
1
vote
1
answer
192
views
Show content from database
This is my first post on Wordpress StackExchange, so please be gentle.
I’ve been working with WordPress for some time but more as a front-end developer and not too much back end dev. I have a ...
0
votes
1
answer
344
views
Add view to admin menu to filter for specific criteria ( If post is child of specific Parent )
add_filter('views_edit-page','addFilter');
function addFilter($views) {
global $wp_query;
$query = array(
'post_type' => 'page',
'post_status' => ...
0
votes
0
answers
1k
views
view counter update in WordPress REST api HTTP get
I use WordPress rest API for app communication with my site in need update post view counter when HTTP get API.
I search a lot but nothing found about it, in a tutorial "Find popular posts with the ...
-1
votes
1
answer
121
views
Remove pipe in views admin page filter
I want to remove the pipes wich are beetween the links in views in the admin page ( For instance in the users page admin) " All (2) | Cutomer (3) | etc... " . How can I do ?
Somebody knows where ...
1
vote
1
answer
81
views
How can I get global $post to work for CPT and update user?
Ive created a custom field in my user_meta which now I want to update the count each time one the user posts are viewed.
Ive got this which works great for standard wordpress posts. However I need it ...
0
votes
0
answers
241
views
Author.php Page views counter
Wondering if some one can help me.
Im looking for a page counter for the author.php
Ive got about 300 authors on the site and they would like a counter to show them how many times there "profiles" ...
0
votes
1
answer
1k
views
How to Display Most View Post in the template file?
I need to create most viewed post column in the template file, but based on post view count?
Function File
function wpb_get_post_views($postID){
$count_key = 'wpb_post_views_count';
$count = ...
1
vote
2
answers
4k
views
How can I count post views of REST API calls and update them in an ACF field?
I don't know if I've complicated things a bit, so I'll explain things from the top. I have a set up with a custom post type (news), which is exposed via the REST API. The main endpoint (/wp-json/wp/v2/...
0
votes
1
answer
143
views
How to keep variable `$post` to using in another file
I create a plugin to quick payment.
When user click button Quick pay. It show popup call views/display-popup.php.
In this file, I declare variable $post.
<?php
global $post;
$id = $post-&...
2
votes
1
answer
233
views
Change post category based on latest posts views
I have a custom field called post_views_count which stores the views of each post on my blog. I would like to use these views to decide which category the posts belong. Here is what I would like to ...
0
votes
1
answer
499
views
How can I create the number of custom post views
I am creating a forum plugin and need to count how many people have seen a certain topic (post_type custom), ideally would be to create a new table or there is a form directly with wordpress.
6
votes
2
answers
230
views
Custom Post Type With Different Views
We are rebuilding our website in Wordpress and are trying to figure out the best solution to display a different views of the same product with unique meta data.
For example, let's say that Property ...
1
vote
2
answers
1k
views
How to improve post views count display?
I wanted to know if i can change the way i display views count in WordPress.
Example: 1000 views = 1k - 10000 views = 10k
I'm counting and viewing post views by using this code:
// Count views
...
-1
votes
1
answer
1k
views
Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode
I'm using Toolset Views to display a list of taxonomies. These taxonomies are under a custom Taxonomy that I created with Toolset Taxonomies. I then used the plugin Taxonomy Images to add the option ...
0
votes
2
answers
25
views
Readers can't view my pages/post whitout logging in?
I don't know what I did wrong but public can only access my front page. Once you click on another page you are ask to log in. I think this is a new issue and maybe due to wrong setting somewhere. But ...
0
votes
1
answer
1k
views
How to display total views of all posts of one category?
Is there any way to display total views of all posts of one category? How to show that number on archive page? I have used this code to count views of each post:
function getPostViews($postID){
$...
2
votes
1
answer
637
views
Double count view in archive.php
I'm having a hard time using this snippet I'm getting double views each time the post is queried.
This is in my functions.php file:
function getPostViews($postID){
$count_key = 'post_views_count';...
0
votes
1
answer
76
views
To remove rendering of menus and header, plugin or theme?
I need to create a view of my website which does not render the header (where I see my user name) and maybe display just one menu on the side.
Do I achieve this through a plugin or through creating a ...
0
votes
1
answer
111
views
How can I make post view count editable? [closed]
In the admin panel, under posts, I see all posts with their view counts next to them. How can I make the view count editable?
I am working on certain things that will kick in when a post reaches 100 ...
3
votes
0
answers
85
views
Tinymce shortcodes within shortcode contents
I am using wp.mce.views.register to create a simple view for my shortcode in the tinymce editor,
this works fine but i am looking for a way to have "nested" shortcodes
e.g.
[column_3]
[info_box]
...
0
votes
0
answers
1k
views
How to display most popular post by views count in WordPress?
I tried to display the most view post in last 30 days in my WP page, how to do this?
What I did is:
<div>Most Read Blog Posts Over Past 30 Days</div>
<?...
0
votes
1
answer
666
views
Get total views of all posts by author
I would like to display the total amount of views per author for all posts. What would be the best way to achieve this without causing too much load on the server?
0
votes
1
answer
3k
views
Post Views / Hit Counter Problem?
I have decide to use WordPress as a CMS to my 5 moths old website. I have already added all previous posts to my new site ( WordPress ). But now I need to change view counts to previous views counts. ...
0
votes
1
answer
180
views
Searching for meta_key returns 0 posts
I am currently on a client project and I am stuck with the meta_key search in WP_Query. I am querying some other parts of the homepage successfully with the WP_Query class, but when I am passing array(...
-1
votes
1
answer
2k
views
Display (custom) post number of views
I'd like to display at the top of every post (actually those are custom posts) the number of times it was viewed by users.
Is there a way to do this ?
0
votes
0
answers
27
views
Pageview all of sudden not working
I am not sure how to explain it.
MY page view count is not working all of sudden.
Here is my code:
$output .= '<div class="mainpageview fa fa-eye">';
$views = get_post_meta( $post->ID,...
0
votes
1
answer
45
views
Showing "0" pageview when there is no view
So, I have the following code to display pageview:
<div class="mypageview"><?php echo get_post_meta( $post->ID, 'pageview', true );?>page view</div>
For example, if there is any ...
0
votes
1
answer
1k
views
How get top post view for today for today post
I insert today 20 post for example.
And i need to get top post that show today from today post.
I try this code but its show me top post view for all time. But I need only for today post.
$day = ...
-2
votes
1
answer
941
views
Updating post_views_count on publish [duplicate]
Upon publishing a post, I'd like the post views count to be a random integer between 829 and 1013.
Could you please tell me what code I need to add to functions.php in order to achieve this?
Thank ...
-1
votes
1
answer
3k
views
Increasing post view count automatically [duplicate]
I am testing a ranking system for posts, and I'd like help with the below:
Upon publishing a new post, I'd like the post view count to immediately have a random number between 829 and 1013 added to ...
3
votes
1
answer
2k
views
WP Admin default view mode for Custom Post Type
To change it globally to excerpt for every post type I can use:
function my_default_posts_list_mode( $default ) {
return 'excerpt';
}
add_filter( 'default-posts-list-mode', '...
-2
votes
2
answers
594
views
Post rank by views
I want show: Post id 5 has 100 views and rank is 2nd, post id 6 has 90 views and rank is 4th, post id 7 has 1100 views and rank is 1st
I try:
$query="SELECT u.*,um.post_id, FIND_IN_SET(
...