- This topic is empty.
-
AuthorPosts
-
May 6, 2011 at 11:42 am #32619cmegownMember
Howdy folks, firstly I’d like to thank Chris and Jeff for writing such an amazing book! I’m very new to WordPress and the book was perfect for getting me started the right way :) That being said…
I’ve taken a little bit from the book, a little bit from the ‘twentyten’ theme, and a little bit from a few other themes, all to try to make my first theme (which is very, very basic). Now, I’ve got my file structure just like the book says (security through obscurity), and while testing my theme I’m getting the following error:
Fatal Error: Call to undefined function get_header() in …
… I’m in serious need of help here folks, I’m not new to programming, but I’m a big WP noob for now.
Secondly, and this is something that is truly confusing me…I’m unable to get any content (posts, pages, etc) in my new theme even though about 90% of the code is the exact same as the code in ‘twentyten’. Any idea why my loops might not be working?
May 6, 2011 at 11:45 am #46920TheDocMemberMany times this error comes up due to a plugin that has been installed. Deactivate all of your plugins to see if it is fixed. If the error goes away, re-activate them one by one until you find the culprit.
The 2010 Theme has its Loops set up quite differently to how I do it, so I can’t quite comment on it. If you post the code that you have for page.php and single.php I’m sure I can get a better idea.
May 6, 2011 at 11:48 am #46916cmegownMemberThank you so much for you quick and kind response!
page.php
get_header();
?>
get_sidebar();
get_footer();
?>single.php
get_header();
?>
get_sidebar();
get_footer();
?>I’m on a local install, so I’d be surprised if it was a plugin, but I’ll check while you review this code :P
May 6, 2011 at 11:50 am #46900cmegownMemberWow, that really butchered my code, those br tags shouldn’t be there!
(Edit: Fixed by TheDoc)
May 6, 2011 at 11:54 am #46884cmegownMemberBtw, my local install has 0 ZERO zip NADDA plugins installed
May 6, 2011 at 12:24 pm #46872ccc630MemberIt could be a problem with the file type — I’ve experienced this same problem working in Coda if I just click the ‘new file’ icon instead of creating a new html-php file through ‘File -> New’. I don’t have enough knowledge to explain *why* that’s the case, though. Hopefully someone else can?
May 6, 2011 at 1:02 pm #46873TheDocMemberOn either page.php or single.php, replace your call to the Loop with this:
That will make sure at least that things are working as they should.
May 6, 2011 at 1:25 pm #46865cmegownMemberThank you for your help guys, the problem has been solved :) Doc, you are right in your method, but I backtracked and discovered that my loop.php had a large number of syntax errors. So once I fixed those, the problem cleared right up!
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.