WordPress.org

Ready to get started?Download WordPress

Forums

Top 10 - Popular posts plugin for WordPress
[resolved] View Count with Custom Post Types in WP-Admin (18 posts)

  1. VinhSonNguyen
    Member
    Posted 11 months ago #

    Hello,

    I was wondering if there was a way to display the view count of custom post types in WP-Admin? (In column form, similar to how normal post views are displayed)

    EX: Portfolio items

    Great work on the plugin!

    Thanks,
    VinhSon

    http://wordpress.org/plugins/top-10/

  2. Ajay
    Member
    Plugin Author

    Posted 11 months ago #

    You should ideally be able to view the columns. I've had success displaying the two columns on custom post types created by the Types plugin. ( http://wp-types.com/ )

    Do you see your custom post types when you goto the Top 10 Settings page?

  3. VinhSonNguyen
    Member
    Posted 11 months ago #

    Hey Ajay,

    Thanks for the response! I believe I may know what's causing the problem.

    My theme has an option to change the portfolio post type name. I have changed my portfolio post type name to ""Tutorials".

    Top 10 sees "Portfolio" as one of the custom post types, but doesn't see "Tutorials", which is why I believe I'm not seeing any statistics in the columns.

    If so, any way to add custom post type to Top 10?

    Thanks for your help!

  4. Ajay
    Member
    Plugin Author

    Posted 11 months ago #

    Which theme is this?

    Is "Portfolio" the same as "Tutorials" ?

  5. VinhSonNguyen
    Member
    Posted 11 months ago #

    It's a theme on Themeforest called Thunder: http://themeforest.net/item/thunder-responsive-multipurpose-theme/5466969

    Yes, the Portfolio is the same as "Tutorials" in a sense. Only difference is that the post type name is renamed from "portfolio" to "tutorials". This is a feature of the theme that changes the post type name.

    Other plugins are recognizing "Tutorials" as a custom post type. Only Top 10 is not recognizing the custom post type.

  6. Ajay
    Member
    Plugin Author

    Posted 11 months ago #

    Could you please post a picture of the General Options, similar to this?

    https://www.wordpress.org/plugins/top-10/screenshot-1.png?r=779108

  7. VinhSonNguyen
    Member
    Posted 10 months ago #

    Hey Ajay,

    Here's a screenshot of the General Options: http://oi42.tinypic.com/2ceiwqf.jpg

    As you can see, "portfolio" post type is recognized, but not "tutorial". Any solution would greatly be appreciated :)

  8. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    Do you know how the theme "renames" the custom post type. My plugin reads the post types as they are stored in the database using get_post_types

    https://codex.wordpress.org/Function_Reference/get_post_types

  9. VinhSonNguyen
    Member
    Posted 10 months ago #

    Sorry, my mistake Ajay. The theme simply changes the label of it, doesn't actually change the name of the custom post type.

    I believe the theme used this plugin for for the portfolio post type: https://github.com/devinsays/portfolio-post-type

    And used this to enable the portfolio post type:
    http://codex.wordpress.org/Function_Reference/register_post_type

    Any help would be appreciated.

    Thanks for your time!

  10. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    I should have asked you this earlier, I notice you have several other post types as well. Are you able to see columns for them.

    Just to be sure I totally didn't misunderstand, you're referring to the Total Views and Daily Views columns in the Posts > All Posts page that you want on the Custom Post Types pages?

  11. VinhSonNguyen
    Member
    Posted 10 months ago #

    Hey Ajay,

    Yes, I am referring to the column of statistics (Total View/Daily View) in the Posts>All Posts page.

    I do not see them for other custom post types (except for WooCommerce products).

  12. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    By any chance, do you see the columns under Screen Options dropdown at the top?

    http://techtites.com/2013/05/15/wordpress-introduction-to-screen-options/

  13. VinhSonNguyen
    Member
    Posted 10 months ago #

    No, there aren't any view options under Screen Options for my custom post types. They are only visible for regular Post, Pages, and WooCommerce Products.

  14. sportsreporter of ny
    Member
    Posted 10 months ago #

    Hi, Not sure if I'm in the right forum but here goees:

    The home page of my site, http://www.sportsreporters.com, used to contain four rotating photos that corresponded to the four most recent articles posted. Now, it looks like this:

    Warning: include(/home/vg008web00/55/86/3018655/web/wordpress//wp-content/plugins/content-gallery/gallery.php) [function.include]: failed to open stream: No such file or directory in /home/vg008web00/55/86/3018655/web/wordpress/wp-content/themes/playmaker2/home.php on line 25

    Warning: include() [function.include]: Failed opening ‘/home/vg008web00/55/86/3018655/web/wordpress//wp-content/plugins/content-gallery/gallery.php’ for inclusion (include_path=’.:/usr/share/php:/usr/share/pear’) in /home/vg008web00/55/86/3018655/web/wordpress/wp-content/themes/playmaker2/home.php on line 25

    Can someone please help me? Thanks.

  15. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    VinhSonNguyen, I'm kind of lost on this point, because the code I use should display it for all custom post types.

    Do you know how the WooCommerce extensions add the column?

    I use the following in admin.inc.php

    add_action('manage_posts_custom_column', 'tptn_value', 10, 2);

    and

    add_filter('manage_posts_columns', 'tptn_column');
  16. VinhSonNguyen
    Member
    Posted 10 months ago #

    Hey Ajay,

    I'm kind of lost at this point as well. Perhaps instead of looking at what's causing it to break, I may just try to add the column in manually in my theme to see how that works.

    Thanks for your time

  17. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    Your welcome. If you do manage to succeed, do let me know what code you've used.

    It might help other users.

  18. cloudcomputing
    Member
    Posted 10 months ago #

    There is no problem with W3 Total Cache plugin?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.