Grow your CSS skills. Land your dream job.

Dreamweaver wp PHP problem

  • # June 19, 2013 at 8:53 pm

    https://docs.google.com/document/d/14jy2rp_v4ODmkXt2ExzWYHxVmznBI3LMo7kMM9rdwdg/edit?usp=sharing

    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!!!

    __
    # June 19, 2013 at 9:25 pm

    …did you define a function named `get_header()`?

    # June 19, 2013 at 9:52 pm

    Wait no. I’m brand new to PHP how do I define a function?

    # June 19, 2013 at 10:04 pm

    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:

    function my_function_name(){
    // code here
    }

    to call this function you would do so like this: `< ?php my_function_name(); ?>`

    you can also pass arguments,

    < ?php

    function sum_of_numbers($num1,$num2){
    return $num1 + $num2;
    }

    sum_of_numbers(3,5);
    // 8

    ?>

    In WordPress all your functions go into `functions.php` file located in your theme folder, if it doesn’t exist, create it…

    __
    # June 19, 2013 at 11:23 pm

    >@traq, this was already answered …

    Alrighty then… and, yes, I second the motion to **not** use dreamweaver. In general; but it will be particularly problematic in this instance.

    # June 19, 2013 at 11:41 pm

    No I completely agree. As I’ve been learning more I continue to see more n more bugs in DW. but wat should I use? I don’t kno how to set up notepad ++ for PHP

    # June 19, 2013 at 11:58 pm

    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.

    # June 20, 2013 at 1:35 am

    ok…ive been messing with all this for two days….i really need help getting this set up….i will like pay you or anyone to either call me and walk my retarted ass through this or have you do it remotely and show me how to do it…..i really just need this set up…. if you or anyone is interested in me paying you plz email me at rwchampin@gmail.com………….someone please

    __
    # June 20, 2013 at 2:06 am

    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.

    # June 20, 2013 at 2:25 am

    Ok the problem is that I don’t fully know what my problem is. I’m extremely new to PHP and servers so I’m not sure. I want to stay in dreamweaver bc I’m not 100% with just code. I usually edit just the code and switch to design mode ever few min. All I know is I set up a test server. Downloaded wp and put the wp file into my htdocs inside of xampp. I made a new site in dreamweaver and linked it to my server. Dreamweaver isn’t discovering all if the files when I open up the index.php. I’m super confused n appreciate all the help but I’m not fully understanding certain things thru ppl telling them to me in the forum. I need a phone call or something lol. I’m dying here lol

    # June 20, 2013 at 2:28 am

    And when I switched to live view in dw it gave me the undefined php action thing in addition to not discovering all the files.

    # June 20, 2013 at 2:28 am

    I just need a visual or verbal walk through

    __
    # June 20, 2013 at 3:14 am

    If you want to stick with DW, that’s fine – but, as mentioned earlier, you **cannot** use the “preview.” You’ll need to check your work in your browser.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".