I have xampp running and installed wp into the htdocs folder and my blank template is inside the themes folder inside the wp folder. Live view is activated. But I keep getting that PHP error. Also when dreamweaver asks me to discover related files it doesn’t open any of the related files. HELP!!!
@traq, this was already answered here: http://css-tricks.com/forums/discussion/25933/help-setting-up-xamp-server-for-dreamweaver
The `get_header()` function is already defined by WordPress, it basically loads `header.php` from your theme directory. The reason you were getting an error you were loading the file directly in your browser. I strongly suggest you go over Dreamwaver documentation, your site is not configured properly, or you could just switch to different editor like Sublime Text 2, Note++, many more…
As for how to define function:
// code here
to call this function you would do so like this: `< ?php my_function_name(); ?>`
you can also pass arguments,
return $num1 + $num2;
In WordPress all your functions go into `functions.php` file located in your theme folder, if it doesn’t exist, create it…
There is nothing to set up with these editors, all you have to do is open the files you’re working on and check the results via internet browser by going to `http://localhost/~path-to-wp-install~`. Now if you are using DW as WYSIWYG editor (where you are not actually writing code, but the program is doing the work) you’ll have issues developing. With the editors I mentioned, you actually need to know how to code.
Are you sure that’s necessary? You’re getting free help _right now_; you just need to better explain which part is tripping you up. From your last few posts, for example, I am unsure:
1) if you are still using DW, or decided to use a plain text/ code editor ([you mentioned notepad++](http://css-tricks.com/forums/discussion/comment/107878/#Comment_107878))
2) if (as @AlenAbdula [asked](http://css-tricks.com/forums/discussion/comment/107880/#Comment_107880)) you need/want a WYSIWYG editor, or if you are working directly with the code
3) if you understand @AlenAbdula‘s [comment](http://css-tricks.com/forums/discussion/comment/107868/#Comment_107868) about needing to view your work _in a browser_, and from _within a WP site_, since WP templates use WP functions that are not available if you view the template file on its own (hence your “undefined function” error)
4) if you understand @BenWalker‘s [comment](http://css-tricks.com/forums/discussion/comment/107848/#Comment_107848) about how to view your WP site on your local machine
…probably more, but I haven’t finished reading through your other thread. SO, clue us in as to what your problems currently are and which direction you want to take.
You must be logged in to reply to this topic.