Questions tagged [views]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
600 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
956 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 = ...
0 votes
0 answers
21 views

How to reset post views count

I need to reset the post views count of a web site. Currently Im using this on my functions.php: function getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($...
0 votes
0 answers
18 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 ...
-1 votes
1 answer
4k views

How to show total view count across all posts for an author

I'm using wp-postviews to track views for posts by authors on my site. It stores the view count in the post meta field $views. I'd want to show on their profile a total count of views for all their ...
0 votes
1 answer
304 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
0 answers
36 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
29 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 ...
5 votes
4 answers
10k views

Hide the post count behind Post Views (Remove All, Published and Trashed) in Custom Post Type

I need to hide/remove the numbers behind the Edit screen in the backend. All (30) | Published (22) | Draft (5) | Pending (2) | Trash (1) As I am running a multi author blog and each author has just ...
0 votes
2 answers
1k views

Embed PDF into wordpress

Is there a way to show a PDF file inside Post in Wordpress? I used the tag but if someone has Internet Download Manager the Dialog will appear to Download the PDF file and then if they click cancel ...
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 ...
0 votes
1 answer
21 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
203 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
627 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
58 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
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
0 answers
98 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
1k 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
118 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
64 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
89 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
6k views

Popular posts by view with Jetpack

I'm using Jetpack to retrieve the number of views for each blog post. Is there a way to use this to generate a call to the most viewed posts and list them? I've been wanting to do that for a long ...
1 vote
1 answer
688 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
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 = ...
0 votes
2 answers
533 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
27 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
61 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
255 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
938 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 ...
0 votes
1 answer
479 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.
-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 ...
-1 votes
1 answer
98 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
71 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
217 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" ...
4 votes
4 answers
27k views

How to Change Loop to Order Posts by Views (using wp-postviews plugin)

I hope somebody would be kind enough to help. I currently have a page that orders all of the posts by comment count, but I want to change the loop to order the posts by view count. I have installed ...
1 vote
2 answers
3k 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
129 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
201 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 ...
4 votes
2 answers
164 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 votes
2 answers
8k views

Show post titles only on the homepage

Is there any way to show a list of all posts without any preview of the content on the homepage?
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
3 answers
16k views

How to display number of page views on a post?

Is there any currently supported plugin to display the number of page views on a post? wp-postviews seems to be the most commonly used, but it requires modifying the theme (which would require ...
1 vote
1 answer
7k views

WooCommerce Grid / List view

Is there any experience with Woocommerce Grid / List view plugin, I set to automatically start the list view but the problem is that while the page is loading initially opens a grid view and instantly ...
0 votes
1 answer
53 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
105 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
81 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
624 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
153 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(...