简体   繁体   中英

Live view in Dreamweaver only works for site root on WordPress site

I am trying to set up DreamWeaver CS6 to show live previews of a locally-stored WordPress site so I can edit template parts and see what they'll look like. I used this tutorial to set it up: https://www.adobe.com/devnet/dreamweaver/articles/dw_wordpress_pt2.html

-The WordPress site is running on localhost (WAMP) just fine.
-Permalink structure is set to default
-Site and test server are set up in DreamWeaver
-I get a working preview in live mode IF I load the root index.php (not the theme's index.php)

The problem is that if I load any individual theme parts, the live preview will return an undefined function error. So the parser seems to be running, but DreamWeaver isn't loading all the necessary requisite files.

Edit: The error below is exactly what you would see if you tried to directly load a theme part in a browser. So I guess my question is, does DreamWeaver have the ability to do what I want? I want to edit individual theme parts while seeing what effect the changes will have in a live preview.

Here's what I get when do live preview for page.php:

( ! ) Fatal error: Call to undefined function get_header() in C:\wamp\www\mysite\wp-content\themes\mytheme\page.php on line 14

Call Stack

#   Time    Memory  Function    Location
1   0.0004  249000  {main}( )   ..\page.php:0

I decided the best solution was to stick with Chrome Developer Tools for a live view and CSS editing, and PHPDesigner (or whatever text-only editor) for template files.

I have to refresh when I modify a template file, but it might have been weird for me to expect live updates in Dreamweaver when I change PHP code (would the parser be constantly reloading everything?).

There's a package called DesktopServer (based on XAMP) that claims to be able to live-view real-time template file changes to PHP code, but it's $99.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM