Support » Fixing WordPress » social sharing of "scheduled posts"

  • rrrnnn


    hey everyone! i’ve a set up as follows;

    we run the website for a band, for the bands upcoming dates we have all those events set up as “scheduled posts”.

    in an “upcoming section” we have the loop displaying the “post_status=future” items from a specific tag/category. then at the time of the event, the post is “published” and displayed as a regular post listing (complete with public link that people can comment on etc.)

    the issue i have at the moment is that we’d like to have share buttons for these future events – so that people can share them in the run up to the event. as of now the posts are “private” until they are published, so clicking the share button for it will return a 404.

    anyway to have this future setup but also have sharing?

    at the moment the scheduled date is for the time of the event (usually 7pm on the event date), i could do something where the publish date is when the article is published (i.e. months in advance) but have the event date displayed then in a custom field return….

    any advice would be appreciated


Viewing 2 replies - 1 through 2 (of 2 total)
  • Jackson


    Try to make your future posts published.

    Then add a where filter to only display certain date ranges, ie:

    function my_filter_where($where = '') {
        $where .= " AND post_date >= '".date('Y-m-d')."' AND post_date < '".date('Y-m-d', strtotime('+90 days'))."'";
        return $where;
    add_filter('posts_where', 'my_filter_where');
    ... your custom query/loop ....
    remove_filter('posts_where', 'my_filter_where');


    oh fantastic! i’ll give that a go!

    much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘social sharing of "scheduled posts"’ is closed to new replies.