WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Most Shared Posts – Social Media counter for Twitter, Facebook & Google ] Custom Post T

[Plugin: Most Shared Posts – Social Media counter for Twitter, Facebook & Google ] Custom Post T

  • ivancamilov
    Participant

    @ivancamilov

    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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Jenny Beaumont
    Member

    @jennybeaumont

    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

    ivancamilov
    Participant

    @ivancamilov

    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!

    Jenny Beaumont
    Member

    @jennybeaumont

    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!

    danmont
    Member

    @danmont

    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Most Shared Posts – Social Media counter for Twitter, Facebook & Google ] Custom Post T’ is closed to new replies.