Support » Developing with WordPress » How to use a pretty permalinks for futured posts?

  • Resolved inickolay


    I want to display future events on my site, but facing with problem:

    According to the code of the_permalink() function, all links of posts ‘draft’, ‘pending’, ‘auto-draft’, ‘future’ will be always “ugly”.

    How i can use pretty permalinks even for ‘future’ posts?

    P.S. I apologize for my English =)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Future events are not the same as scheduled posts. Scheduled posts are scheduled because they’re not supposed to be public until that date, so it wouldn’t make sense to create a public link to them.

    If you have events posts that you want to display, you should create a separate custom field for the event date, as opposed to the publication date.

    Are you just posting events as Posts, or using an Events plugin of some kind?



    Thank you for answer!

    I’m just posting events as Posts.

    So, you wants to say, that there’s no way to use default date field?
    I’m just don’t want duplicate fields 🙁

    Moderator bcworkz


    You can filter the_permalink() function output, but that will not get a post when using the resulting link because the post is not yet published. Event date and post date are two different things, you are not duplicating data. I’d suggest storing event dates as post meta, using UNIX timestamp format. It’s difficult to query for posts by date range using most common human readable formats. The one exception would be yyyy-mm-dd.



    Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use a pretty permalinks for futured posts?’ is closed to new replies.