moikirsch
Member
Posted 3 years ago #
I was looking for a way to let someone see a post in the future without the need to be logged in.
Right now I have a query to display all posts in the future (post status=future).
I found this:
http://wordpress.org/support/topic/141099?replies=2
Does anyone know if there is a way to accomplish this without hacking a core file?
I cannot change the status of the post (the way "the future is now" plugin does) because it messes with the loop everywhere else.
Is there a way to modified the query by adding some type of variable or something similar?
Don't quite understand the need for displaying a future post on a blog, but try this:
<?php
$posts=get_posts('post_type=post&post_status=future');
if ($posts) {
foreach($posts as $post) {
setup_postdata($post); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
}
}
?>
moikirsch
Member
Posted 3 years ago #
I can get the posts without a problem... the issue is when you click on the permalink.
Single.php returns a 404.
The reason to display this is to be able to post about future events, classes, etc.
moikirsch
Member
Posted 3 years ago #
I decided to use the following plugin:
http://wordpress.org/extend/plugins/events-category/
Not the best solution for me, but in this case "good enough".
discern
Member
Posted 2 years ago #
One reason for this would be to allow posts of a certain category—say, “Events”—to be used in an “upcoming events” listing. That is what I want to use this for.
How can I get a scheduled (published, but future-dated) post to actually appear if you are not logged in? I have the sidebar list set up. It has two sections: Recent Posts and Upcoming Events. The latter shows only scheduled posts with the category “Event.” The problem is, when I click on the event, I get the 404 error, like moikirsch.
jadedjo
Member
Posted 2 years ago #
I'm looking for a solution this exact same problem and I would prefer not to use a plugin.
Anyone????
discern
Member
Posted 2 years ago #
I concocted a way to do this using page templates and custom widgets. It involves a little more than just activating a plugin, but it]s pretty simple and does the trick.