Questions tagged [views]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
3k views

Creating a custom MCE view for your shortcodes [closed]

How to create a custom MCE view of my own WordPress shortcode?
dtbaker's user avatar
  • 357
0 votes
1 answer
2k 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 ...
dtbaker's user avatar
  • 357
0 votes
0 answers
72 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 ...
vyperlook's user avatar
  • 177
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 ...
Joseph's user avatar
  • 1
5 votes
4 answers
11k 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 ...
Traveler's user avatar
  • 197
1 vote
1 answer
109 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 ...
member8888's user avatar
1 vote
1 answer
6k views

Sorting posts according to view counts not working

I use the code snippet below to get views count of each post on my sidebar.php . everything works but the sorting does not. also it does not get 4 posts, it only shows 1 post although I've written '...
Payam Shakibafar's user avatar
1 vote
1 answer
386 views

Show number of views in the last 48 hours

I have now the most popular views on the posts I have. But I want to show the most viewed in the last 48 hours. How can I achieve that? Someone helped me and I placed this in single.php file. $...
Kilwa's user avatar
  • 13
-1 votes
1 answer
404 views

Changing comment_count to views

I have a plugin installed to show the latest popular posts based on number of comments. But comments are disabled on my website. How can I change it to number of views? And do I need to install ...
Kilwa's user avatar
  • 13
0 votes
2 answers
1k views

Count post views in loop

I'm trying to show the post views for every post on a blog page (so in a loop). I tried it with the following code in the functions.php: // function to count views. function setAndViewPostViews($...
Trekdrop's user avatar
  • 245
-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?
Bulki's user avatar
  • 109
0 votes
1 answer
1k views

count the number of views of a post excluding own views

I am using WP Post Views plugin to display the post number of views. To do so, I use: <?php if(function_exists('the_views')) { the_views(); } ?> This plugin gives 3 choises in its setting : ...
whiteletters in blankpapers's user avatar
0 votes
1 answer
236 views

an action hook when a post reaches a certain number of views

I am using WP Post Views plugin to display the post number of views. I use: <?php if(function_exists('the_views')) { the_views(); } ?> I am creating a badge system for my wordpress site. My ...
whiteletters in blankpapers's user avatar
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 ...
japanworm's user avatar
  • 567
-1 votes
1 answer
87 views

Integrating CSS Into a WP Function Call [closed]

Below is a code I use to display post views. It is integrated with an options panel which allows users to choose whether to display it. I would like to integrate the div class .postviews directly ...
AndrettiMilas's user avatar
1 vote
2 answers
3k views

WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term

OK so I'm about 90% done, the only part that keeps breaking is when I try to exclude a specific taxonomy term. Break down: Sorting: ('v_sort' => 'views') This is being done via the popular WP-...
Chozen's user avatar
  • 163
0 votes
1 answer
76 views

Posts being viewed

I am looking for a way to list posts being viewed but I can't find anything online. Is it even possible? I've seen some websites that have these loops, "What other readers are currently reading". I'...
David Garcia's user avatar
0 votes
1 answer
127 views

how can view all three subcategory in same line(found ex: and code)

i use the code to view subcategory on category page <?php if(is_category()) { $breakpoint = 0; $thiscat = get_term( get_query_var('cat') , 'category' ); $subcategories = get_terms( '...
user2075379's user avatar
0 votes
1 answer
186 views

Post Views Code Hacks

// Post views function getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ ...
AndrettiMilas's user avatar
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 ...
Dime's user avatar
  • 69
0 votes
1 answer
299 views

how to localize the number of wordpress post views?

I want to display post view in localize number. I add these function in function.php to do so function make_bangla_number($str) { $engNumber = array(1,2,3,4,5,6,7,8,9,0); $bangNumber = array('...
pervez's user avatar
  • 19
0 votes
1 answer
3k views

Display posts from Last 24 hours and order them based on most views

I am trying to display the posts of last 24 hours and order them by most views. I call the most views by this code: query_posts('meta_key=post_views_count&orderby=meta_value_num&...
pervez's user avatar
  • 19
0 votes
1 answer
2k views

Check if post id exist in table than only update instead of inserting new row

I am trying to add simple view counter for my advert and everything seems works fine with below code but only it is inserting each time new row on post "Update". What I want if the post id is exists ...
pixelngrain's user avatar
  • 1,400
-1 votes
1 answer
4k views

Remove 'portfolio' from URL

I was trying to remove portfolio-view from url and followed instructions to remove its name from highlighted section. This works but has left me with 'portfolio' now even though field is blank. What ...
James Hughes's user avatar
3 votes
1 answer
1k views

Writing a view count with w3 total cache

I am trying to develop functionality which counts how many times a post is viewed however I am also using page caching (APC possible memcache in the future) via w3 total cache. The "view count" value ...
Jase Whatson's user avatar
2 votes
1 answer
92 views

How to add "time" data this?

I am using this simple snippets to get post view count for a long time I was wondering if we can add a "time" data ? Because I would like to show the view of yesterday/ 2 days ago / 2 days ago etc... ...
Nisha_at_Behance's user avatar
1 vote
0 answers
961 views

define orderby URL with meta_key=post_views_count

I want to make an url with meta_key=post_views_count. E.g: http://www.mysampleweb.com/?meta_key=post_views_count&orderby=meta_value&order=DESC So the posts should be ordered by Views. ...
ad2003's user avatar
  • 251
0 votes
1 answer
1k views

show most viewed posts of last days by link?

I use this link to get most viewed posts: http://mydomain.com/?post_type=movies&meta_key=post_views_count&orderby=meta_value&order=ASC But that gives me ALL posts from this post type in ...
ad2003's user avatar
  • 251
0 votes
1 answer
1k views

sort posts by getPostViews in functions.php

I have the following function in functions.php that allows sorting alphabetically or by recency. I want to change the alphabetic to sort by most viewed. This is the code I have for the sorter, which ...
Donna's user avatar
  • 81
-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 ...
Pollux Khafra's user avatar
0 votes
1 answer
2k views

Does wp track views for posts?

I want to do a query and sort posts by views. Is this possible? I'm not even sure where to start..
Jacksonkr's user avatar
  • 357
0 votes
2 answers
1k views

sort post types by amount of views

I have a custom post type that I want to do a type of news feed for, but I only want to show the ones with the most views. I know I can do a query for an "archive" of my post types, but my question is ...
Jacksonkr's user avatar
  • 357
1 vote
1 answer
216 views

Make view count for pop up post

I'm using SimpleModal to allow users to click on a post excerpt on my homepage and popup a box showing the full post. However it doesn't count for an actual view of the post when this happens. Is ...
Pollux Khafra's user avatar
0 votes
1 answer
883 views

How to sort a loop after most viewed

I have a site and i'm almost done with it. It have teached me a lot about wordpress, although i'm still a noob who doesn't know anything about php or programming (besides html). I have managed to ...
Torben's user avatar
  • 57
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 ...
cboettig's user avatar
  • 423
1 vote
2 answers
978 views

Is there a way to have the view link on manage posts page to open in a new window or tab?

Hi I am trying to figure out on how to get the "view" link on the manage posts / custom post types and pages to open in a new tab or window. I know it is probably possible to do via the functions....
Nicole's user avatar
  • 832
2 votes
3 answers
4k views

Counting pageviews on high-traffic cached sites

Our site is quite high traffic and we use both nginx and w3 total cache to handle the load. We've previously been using wp-postviews to count the page views, but it seems to be locking the postmeta ...
James Bruce's user avatar
1 vote
1 answer
747 views

Add link on the top menu of the post table?

Is there any way to add links on the top, as pictured below?
andre's user avatar
  • 11
1 vote
1 answer
711 views

How to remove the Unattached filter on Media Library List?

For example, at /wp-admin/upload.php are displayed the following filters by: All (6) | Images (6) | Unattached (6) How can I remove the "Unattached (6)" filter by? Thanks in advance.
José Pablo Orozco Marín's user avatar
2 votes
3 answers
1k views

Community and User Generated Content Website: Have been thinking about Drupal but leaning on Wordpress heavily

I'm a non-programmer and run a food website (plain - jane Dreamweaver) along with a simple Wordpress powered blog. I envisioned creating a food website that is both user powered (one can submit ...
user avatar
4 votes
4 answers
29k 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 ...
PG73's user avatar
  • 111
1 vote
2 answers
248 views

How to find time last viewed?

I want to run an update script on pages that haven't been viewed and updated within X days. I'm using post meta to cache some related RSS feed data, and I want it updated once a week or two, but only ...
Dan Gayle's user avatar
  • 6,116

1
2