Tim Derouin on "WP directory is in a folder within the root, preview will not work"

ساخت وبلاگ

We have WordPress installed in a folder titled "web" so the WordPress address and Site address under General Settings is different. As a result, the preview and preview changes functions do not work.

I found a solution (https://wordpress.org/support/topic/pagepost-preview-not-working?replies=20) by adding "/index.php/" directly after the domain name, as seen below, but would prefer to have something to enter in to functions.php as a hard coded work around. However, I do not know where to start or if what I am suggesting is even possible.

Problem URL

http://www.mydomain.com/about/?preview_id=6...

Manually entered "fix"

http://www.mydomain.com/index.php/about/?preview_id=6...

Also, if a post/page has already been published the preview will show the page without edits (unless I change the URL as noted above). However, if I attempt to preview a page/post that has not yet been published the preview only shows the home page.

Any help/guidance is greatly appreciated. Thanks!

What type of structure do you have your permalinks set to?

WP-Dashboard > Settings > Permalinks

Your htaccess file will change according to the permalinks setting. Can you try setting it to post-name, for example? I'd also recommend that you not use the default setting, ie use pretty permalinks.

I do have permalinks set to post name already (I agree not to use the default setting!). I also tried going into the permalink settings and clicking save changes as I have found that simply going into settings areas and clicking save without any changes can fix odd glithces from time to time. No success yet...

Since manually adding in index.php directly after the domain name works, I was wondering if there is anyway to add some action in functions.php top automatically place that in the preview URL only.

Thoughts?

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 259 تاريخ : سه شنبه 28 ارديبهشت 1395 ساعت: 20:29