Well, it is possible already.
By default the Import button allows you to import the data from WP-PostViews plugin. But if you have any plugin or custom code that stores post views in meta key (and you know it’s name) you can use a pvc_import_meta_key filter hook.
As far as I know Jetpack stores total views in ‘jetpack-post-views’ meta key. So add this code to functions.php of yur theme:
// Change the meta key - source of total views count
function custom_pvc_import_meta_key( $meta_key ) {
return 'jetpack-post-views';
}
add_filter( 'pvc_import_meta_key', 'custom_pvc_import_meta_key' );
Then open PVC settings page and click import.
Not tested but should work.
Thank! I will experiment with that, and will let you know how it goes. –Rick
Two more questions:
(1) I’d like to have the post views data be displayed on the same line as the time and author meta data show up below the title of the post, on the single post page, rather than on a new line. How would you suggest making that happen?
(2) I’d also like to have the same post views information show up on the main blog page, so each post shown on the homepage has a views count. Is there a shortcode or suggested tag for doing that?
thanks
Rick
@deviceguru, how did importing those stats from Jetpack work out for you? I’ve been thinking of using this plugin but I too can’t start from scratch.
@popmythology: I wasn’t able to get it do what I needed. Then I started searching for ways to import data from Google Analytics, instead of from Jetpack, and discovered a WP plugin that has done the trick extremely well for my purposes. It’s called Google Analytics Post Pageviews, by maximevalette.
-
This reply was modified 9 years, 8 months ago by
deviceguru.
@popmythology use the code snipped we provided, paste it into functions.php of your current theme, go to PVC settings and click Import.
Done.
Regards,
Bartosz / dfactory team
@dfactory @deviceguru Many thanks to the both of you. I will try both methods suggested and see which works better for me.
@dfactory when I pasted that code snippet into the functions.php file of my theme, it seemed to break my site. When I went to the site the screen was just blank. Have you heard of this happening to anyone else before?
EDIT: What’s extra weird is that if I type in http://www.popmythology.com into my address bar the site comes up. But if I just type popmythology.com, the screen is blank. It shouldn’t matter – the site should come up either way. Do you know what happened? Please help ASAP!
-
This reply was modified 9 years, 8 months ago by
popmythology.
Maybe you just pasted the code in the wrong place. But genreally it looks like you’re having issues in your WP install that doesn’t come from our plugin or the code above.
@dfactory, do you know what kinds of problems you saw in my WP install?