Thursday, July 11, 2013

Back from college - wp options panel day 6

I had college orientation and a bunch of other stuff to take care of which is why I was gone for so long.  I my free time though I have been designing a new WordPress theme called Boundaries for Breaking.  So far I've only designed it in Photoshop and it looks pretty good.  When I code it it'll be named b4b and I need to re-size it because the design is a bit small.  Since I haven't been learning about the settings api like I should have I'm going back to learning about it for most of today.

Before I even get started with taking notes, I had to fix my localhost (wampserver) first.  What was wrong with it?  This was the error:

I fixed it by following the advice from the first responders on these two threads:

Okay back to note taking...  So in this tutorial http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-4-on-theme-options/ the author goes over categorizing all the fields in each section to a single option.  Once you define multiple option sections and display them using settings_fields(), do_settings_sections() and submit_button() wrapped in a form only the newest defined option will actually save.

Now for part 5, http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-5-tabbed-navigation-for-your-settings-page/, he says you can keep these option groups and still save with using tabs instead of new pages.  I only got to the very beginning of this tutorial before I ran into troubles and couldn't get anything working.  The non-working code is here: http://pastebin.com/xVmuKjcc

I'm back to this code now though cause it is still working: http://pastebin.com/3HLKhuQG

I'm going to read through part 5 again and try to add tabs to my code even with only one set of options.  Didn't add tabs still yet but added the image uploader by following and making modifications/additions to the code from these two tutorials:

Here's the code at the end of today: http://pastebin.com/c9U3gD0Z
Here's the additional js file: http://pastebin.com/ErZy47vc

Pce niggs.

No comments:

Post a Comment