WordPress.org

Ready to get started?Download WordPress

Forums

social sharing of "scheduled posts" (3 posts)

  1. rrrnnn
    Member
    Posted 2 years ago #

    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

    darren.

  2. Jackson
    Member
    Posted 2 years ago #

    Try http://wordpress.org/extend/plugins/the-future-is-now/ 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');
  3. rrrnnn
    Member
    Posted 2 years ago #

    oh fantastic! i'll give that a go!

    much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic