WordPress.org

Ready to get started?Download WordPress

Forums

  1. ivancamilov
    Member
    Posted 2 years ago #

    Hi... a quick improvement you can make to your plugin is to make sure that Custom Post Types can be included in the counts as well.

    You can do this pretty quickly in the most_shared_posts_update_social_data function, by adding the post_type => any argument to your query, like this:


    $args = array(
    'posts_per_page' => 500,
    'orderby' => 'date',
    'order' => 'DESC',
    'ignore_sticky_posts' => 1,
    'post_type' => 'any'
    );

    Thanks!

    http://wordpress.org/extend/plugins/most-shared-posts/

  2. jennybeaumont
    Member
    Posted 2 years ago #

    Hi ivancamilov,

    I'm just looking into this plugin for use on a site and am curious about your post. Can you give me an example of a case where a custom post type would be shared on a social media site?

    thnx!
    -jennyb

  3. ivancamilov
    Member
    Posted 2 years ago #

    Hi Jenny

    Custom post types are pretty useful in a lot of ways; perhaps you have a site about lifestyle where recipes are part of it, and you would like to handle "Food" and "Drink" as custom post types, so you could have additional custom fields or taxonomies applied to them.

    In that case, you'd definitely want to share your recipes on social sites to get more traffic to your site. As a matter of fact, by using stuff like Facebook's Open Graph you could have your users share stuff like "Camilo prepared a Vodka Martini on jennysplace.com" on your user's timeline.

    Cheers!

  4. jennybeaumont
    Member
    Posted 2 years ago #

    So you're talking about sharing a "page" of posts, defined by category or other post type? Cool indeed...and I see then why that would be tricky to list as "most shared". Interesting food for thought, cheers!

  5. danmont
    Member
    Posted 1 year ago #

    Hi ivancamilov,

    My theme uses custom post types so I definitely need to add the argument code you mentioned for it to work on my site. Im a bit new to coding so wold you let me know what file or where to ad the argument to?

    Thank you!

    anyone's input would be much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic