Skip to main content
added 6 characters in body
Source Link
Tom J Nowell
  • 60.6k
  • 7
  • 77
  • 147

I have been able to list out pages that are set for future in a custom template like this:

query_posts('post_type=page&post_status=future&posts_per_page=100&order=asc&orderby=date&meta_key=_wp_page_template&meta_value=show.php');

However, when I try to then click on one of the pages listed there I get a 404 (as a non-logged-in user).

How do I alter a thematic page.phppage.php template to show a future page?

We are already using a bunch of things in function.phpfunction.php and have a special page template for this particular type of post...

I tried adding the following to the functions.phpfunctions.php with add_filter, but it didn't help:

function show_future_where($where) {
    return $where . ' AND (wp_posts.post_status = \'publish\' OR wp_posts.post_status = \'future\')';
}

BTW, I saw a post about automatically setting a post with a future date would be overridden with 'published' state, but couldn't get that to work.

If I can edit the page template is there something else I can do?

I am using 3.3, if that helps.

Thanks.

I have been able to list out pages that are set for future in a custom template like this:

query_posts('post_type=page&post_status=future&posts_per_page=100&order=asc&orderby=date&meta_key=_wp_page_template&meta_value=show.php');

However, when I try to then click on one of the pages listed there I get a 404 (as a non-logged-in user).

How do I alter a thematic page.php template to show a future page?

We are already using a bunch of things in function.php and have a special page template for this particular type of post...

I tried adding the following to the functions.php with add_filter, but it didn't help:

function show_future_where($where) {
    return $where . ' AND (wp_posts.post_status = \'publish\' OR wp_posts.post_status = \'future\')';
}

BTW, I saw a post about automatically setting a post with a future date would be overridden with 'published' state, but couldn't get that to work.

If I can edit the page template is there something else I can do?

I am using 3.3, if that helps.

Thanks.

I have been able to list out pages that are set for future in a custom template like this:

query_posts('post_type=page&post_status=future&posts_per_page=100&order=asc&orderby=date&meta_key=_wp_page_template&meta_value=show.php');

However, when I try to then click on one of the pages listed there I get a 404 (as a non-logged-in user).

How do I alter a thematic page.php template to show a future page?

We are already using a bunch of things in function.php and have a special page template for this particular type of post...

I tried adding the following to the functions.php with add_filter, but it didn't help:

function show_future_where($where) {
    return $where . ' AND (wp_posts.post_status = \'publish\' OR wp_posts.post_status = \'future\')';
}

BTW, I saw a post about automatically setting a post with a future date would be overridden with 'published' state, but couldn't get that to work.

If I can edit the page template is there something else I can do?

I am using 3.3, if that helps.

Thanks.

Adding some appropriate tags.
Link
Source Link

Allow non-logged in users to see a future post after clicking on a list of future posts

I have been able to list out pages that are set for future in a custom template like this:

query_posts('post_type=page&post_status=future&posts_per_page=100&order=asc&orderby=date&meta_key=_wp_page_template&meta_value=show.php');

However, when I try to then click on one of the pages listed there I get a 404 (as a non-logged-in user).

How do I alter a thematic page.php template to show a future page?

We are already using a bunch of things in function.php and have a special page template for this particular type of post...

I tried adding the following to the functions.php with add_filter, but it didn't help:

function show_future_where($where) {
    return $where . ' AND (wp_posts.post_status = \'publish\' OR wp_posts.post_status = \'future\')';
}

BTW, I saw a post about automatically setting a post with a future date would be overridden with 'published' state, but couldn't get that to work.

If I can edit the page template is there something else I can do?

I am using 3.3, if that helps.

Thanks.