I am hoping you can give some help. I bought the e-book “WordPress Anthology” and I have started to work though the code examples in Chapter 3.
WHERE am I supposed to create/place my work?
Do I change index.php in the twentyeleven theme directory? Do I create a child theme and work in there? Do I alter the index.php in the root directory?
It doesn’t really say unless I’ve really missed it. I’ve read Chapter 3 quite a few times looking for specific directions. On page 58 it shows a little code snippet to demonstrate the default loop, but does not say where this snippet should go to function correctly.
And then we have the code excerpts extracted from the code archive: index.php, loop-index.php … WP_Query.php (etc). How are these called?? In what directory do I put them to test my work? Do they automatically get called in The Loop contained in index.php??
correct me if I am wrong, I found this post while doing another search so just replying as I am sure someone knows the exact answer and they may reply here. You never should edit any of the root files or wordpress core files. You would edit your theme file, either the page, single, index… depending on what you were trying to accomplish(basically creating custom page/post template files). I haven’t touched child themes yet though. Still experimenting with other things slowly.
I’m still a bit confused. I’ve tried making a copy of index.php and placing it in a ‘twentytenchild’ directory. I can get the child css to work, but not any of the code changes made in the new twentytenchild/index.php.
you can see HTML mark-up and PHP logic and function calls.
AFAIK, most of what the chapter is dealing with should go in whatever theme your using’s index.php file, inside “the loop”.
“The loop” is the “while” i.e.
the opening
while (have_posts()) : the_post();
and the closing
endwhile;