Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make the Preview link on a WordPress post or page point somewhere else?
    primarykey
    data
    text
    <p>I've done a lot of small projects on the side lately where the client wants a good chunk of the website to stay the same, they just want to be able to edit particular "areas" of the site. Namely, some text in some box somewhere. </p> <p>I've found that WordPress works for this pretty well. The interface is nice and friendly to use, and it's got lots of work behind it so I don't have to reinvent wheels, fix bugs, etc. </p> <p>So what I wind up doing is making PHP pages which look like what the client wants, then making the content editable areas contain a particular post or page, which is what is editable in WordPress.</p> <p>I'm having the particular page's contents displayed on the page using code like this</p> <pre><code>&lt;?php echo apply_filters('the_content', $page_Contact-&gt;post_content); ?&gt; </code></pre> <p>where <code>$page_Contact</code> is a variable defined elsewhere.</p> <p>However, the "Preview" or "View Page"/"View Post" function on each page/post goes to the logical WordPress location and this is not the effect I want in this case.</p> <p>So for example I have pages like this</p> <pre><code>www.site.com/index.php www.site.com/about.php www.site.com/contact.php </code></pre> <p>And so forth. </p> <p>WordPress wants to have the "View Page" and "Preview Changes" links go places like </p> <pre><code>www.site.com/?page_id=2 www.site.com/?page_id=8&amp;preview=true&amp;preview_id=8&amp;preview_nonce=45522671f5 </code></pre> <p>Which is a problem because, in the permalink structure above, both of those go to the index.php page which, except for the page I'm using to structure index.php, it's not where I want the user/editor to go. And none of the cases above allow any sort of preview (which is a concession I'm willing to make given how I'm doing this)</p> <p>Is there a way, <strong>preferably using a plugin</strong> to rig WordPress such that the preview for a page in the dashboard goes to a preview of the non-index.php page where the content will be housed? So for example the link for the "Contact" page in WordPress's dashboard goes to <code>contact.php</code> instead of <code>?page_id=2</code>? This is a deal where I'm trying to get this done <em>in the editing interface</em> and I'm not concerned about the links in the site itself.</p> <p>Obviously I would need to maintain this per-page and this would be a situation where new pages don't go up unless I put them there.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload