Opened 13 years ago
Closed 12 years ago
#18872 closed defect (bug) (worksforme)
Preview of drafted posts not possible when front page is set to a static page
Reported by: | jnthnlstr | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.2.1 |
Component: | General | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
Problem: It is not possible to preview posts when you have set your front page to be a static page
Steps to reproduce:
- create a new blog
- create a page
- go to Settings->Reading
- select your page in the 'static page' for the front page
Then, there are some variants...
1st variant:
- create a new post, do not publish
- do not click 'save draft'
- click 'preview'
- observe: visible front page, URL is like /?p=78&preview=true
2nd variant:
- create a new post, do not publish
- click 'save draft'
- click 'preview'
- observe: visible front page, URL is like /?p=80&preview=true
3rd variant:
- create a new post
- publish
- make a change
- hit 'preview changes'
- observe: correct page preview, URL is like /new-post-three?preview=true&preview_id=83&preview_nonce=084e8f6b22
4th variant:
- create a new post
- publish
- change status to 'draft', click 'update'
- hit 'preview'
- observe: visible front page, URL is like /?p=86&preview=true
Conclusion: draft pages not previewable when front page set to static page.
Change History (4)
#2
@
13 years ago
I imagine this could happen if this block in query.php
runs when it shouldn't:
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/query.php#L2004
Normally, when doing a preview, the first two conditions aren't satisfied at the same time.
But when I tried to hook into pre_get_posts
and set $query->is_home = 1
, the results I got were similar to the ticket description.
This also reminded me of #13779 (having cookie issues due to different URLs for "WordPress Address" and "Site Address"), but in that case, 404 template would be displayed, not the front page.
Are you running any form of caching? I can't duplicate this.
What Permalink settings are you using? Do you see the same with the Default (ugly - ?p=123) as you do with /%postname%/ (Which is what I assume you're using?)