admin管理员组文章数量:1122832
The preview function works fine when posts are just draft. The url looks like this : /?p=12&preview=true
Then when I pubish my posts, let's say I want to change something and preview it, the url looks like this : /?preview=true&preview_id=12&preview_nonce=514e88946a&post_format=standard
The problem is it does reflect any changes ...
I use WordPress 3.9.2 running Twenty Fourteen theme without any plugins
EDIT
I've turn the permalink to default and it resolve the problem. But I need it to work using the pretty url ... Thanks for your help
The preview function works fine when posts are just draft. The url looks like this : http://exemple.domain.com/blog/?p=12&preview=true
Then when I pubish my posts, let's say I want to change something and preview it, the url looks like this : http://exemple.domain.com/blog/my-article-title/?preview=true&preview_id=12&preview_nonce=514e88946a&post_format=standard
The problem is it does reflect any changes ...
I use WordPress 3.9.2 running Twenty Fourteen theme without any plugins
EDIT
I've turn the permalink to default and it resolve the problem. But I need it to work using the pretty url ... Thanks for your help
Share Improve this question edited Aug 22, 2014 at 10:03 0x1gene asked Aug 22, 2014 at 9:56 0x1gene0x1gene 1395 bronze badges 2- Do you have any caching on? – Steven Jones Commented Aug 22, 2014 at 11:13
- @StevenJones no I don't – 0x1gene Commented Aug 22, 2014 at 11:13
2 Answers
Reset to default 0You need to define the %postname% permalink and be sure that the .htaccess is modified.
If your .htaccess has blocked access you can do it manually.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
You can see more info at the Codex, just look for "Using "Pretty" permalinks".
This is probably not the best way to do it since it wont persist after wordpress updates (but hopefully the update will correct it.
In wp-admin/includes/post.php
,edit the post_preview()
function just before returning the apply_filters( 'preview_post_link', $url );
put the following code:
//ORIGINAL
//$url = add_query_arg( $query_args, get_permalink( $post->ID, true ) );
//CHANGES to make the preview work even with postname in the URL
$query_args['p'] = $post->ID;
$url = add_query_arg( $query_args, get_permalink( $post->ID, true ) );
$url = str_replace('%postname%/', '', $url);
//END CHANGES
But still if there is any way to make it better ?
本文标签: publishI can39t preview post39s change once they are published
版权声明:本文标题:publish - I can't preview post's change once they are published 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736293704a1929200.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论