The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [views]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

I want to get latest one post of a particular category

I want to get the latest one post on counting View Count. Latest I have tried this but didn't get the result : $popularpost = new WP_Query( array( 'post_type' => 'post', 'posts_per_page'...
0
votes
1answer
12 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
0answers
19 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 ...
0
votes
0answers
12 views

Crate SQL view in WordPress database from custom post types and fields

I'm trying to create a mysql view inside WP database that selects and then show some custom post fields. E.g.: with custom post types Movies and Reviews create an SQL view with movies name, ID and it'...
-2
votes
1answer
89 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
1answer
23 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
1answer
26 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
1answer
30 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
1answer
95 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
0answers
47 views

Displaying most viewed posts from last 7 days with views count via Wordpress rss feed

I need two feeds for my WP-website. One should be ordinary wp post feed< the other - must show most viewed post from last seven days with views count. I also want to show post views from WP-...
0
votes
2answers
79 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
1answer
19 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
1answer
35 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
1answer
65 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
0answers
328 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
1answer
52 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
1answer
41 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
0answers
98 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
1answer
378 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
2answers
2k 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
1answer
42 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
1answer
123 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 ...
1
vote
1answer
340 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.
4
votes
2answers
74 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
2answers
688 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
1answer
971 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
2answers
24 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
1answer
679 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
1answer
436 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
1answer
36 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
1answer
93 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
0answers
71 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
0answers
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
1answer
541 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
1answer
2k 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
1answer
123 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
1answer
1k 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
0answers
23 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
1answer
30 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
1answer
500 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
1answer
616 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
1answer
2k 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 ...
2
votes
1answer
1k 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
2answers
273 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( ...
3
votes
1answer
3k views

Creating a custom MCE view for your shortcodes [closed]

How to create a custom MCE view of my own WordPress shortcode?
0
votes
1answer
1k views

Getting shortcode attribute values and shortcode content with JavaScript regex

This is an example shortcode: [boutique_banner title="Loyalty Program:" link="More" linkhref="/"]Earn 1 point for every $5 spent[/boutique_banner] I have created a custom mce view to display this ...
0
votes
0answers
67 views

Count how many posts a user has viewed

Seems this is quite a new question, as I found it nowhere. I was wondering if it is possible to count how many posts a registered user has viewed (entered) on the frontend. So basically when a user ...
0
votes
2answers
977 views

Embed PDF into wordpress

is there's a way to show a PDF file inside Post in wordpress ? i used tag but if someone have Internet Download Manager , Dialog will appear to Download the PDF file if visitor click cancel they ...
5
votes
3answers
8k 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 ...
1
vote
1answer
96 views

Custom view counts not updating correctly

I'm trying to add some custom views/filters to the list of posts for a custom post type in the admin. However, the query that counts the number of posts is updating the number of posts for all filters ...