Tag Archives: custom fields

Diving into WordPress Documentation and Using PHP

This week’s readings about the various features of WordPress helped me think in more detail about how I want my final project site to look and what features and customizations I want to include. I spent a lot of time last week browsing through the many themes on WordPress.org, and am still deciding between two very similar themes — Retina and Wisteria. The “What is a Theme?” article was helpful in terms of thinking about the various parts that make up a theme and why plugins are important to use when adding functionality to a site.

The reading about plugins was interesting because I’m still going back and forth about whether or not I should create a new plugin to link my Strava profile to my site, or instead customize one of the existing Strava plugins available on WordPress. I need to do more research and take a closer look at the code on some of the existing plugins to see what exactly I would like to customize. I also will likely have to contact the creators of the original plugin and obtain their permission to customize their plugin.

After reading the documentation about custom fields, I decided that this was something I’d like to incorporate into my final project. I’m not sure, however, whether this would count as an actual customization, since it seems pretty straightforward and easy to do using the <?php the_meta(); ?> tag. Is this really all there is to it? If so, does this count as a customization?

After completing the readings, I had a better understanding of how WordPress uses multiple PHP files and templates to create themes and custom websites. Speaking of PHP, one of the other assignments for this week was to add PHP to our existing HTML homepage that we started building earlier in the semester. I created a contact form — modeled after the W3 Schools form — featuring four fields and labels (name, email, your website, and comment). After a lot of Googling and trial and error, I was able to figure out how to use the <textarea> function in HTML to make my comment box larger and able to accommodate multiple lines of text. For anyone interested in learning how to do this, this Stack Overflow thread might be useful. I’ll likely build my own PHP form as one of my customizations on my final project site.

I almost forgot to mention that I officially purchased my domain and hosting on GoDaddy! My site will be called The Running (G)lover (a not-so-clever play on both my last name and the topic of my site), and my domain is www.therunningglover.com. I ended up purchasing the economy hosting plan for three months, but have high hopes that my finished site will look amazing and that I’ll be motivated to keep it going after the semester ends.

I’m looking forward to working on my final project site this coming week!

Questions from Week 7 Readings

I thought out readings this week were very helpful, especially because I actually understood some of the concepts on first glance without having to Google search every other word in the document. A few terms that I did struggle with a bit were as follows:

  1. WP_DEBUG – When I first read through the instructions, I understood how to turn this on and off the debugging feature from the instructions provided, but did not understand what that would show on the site? Does this show you errors in your code on Sublime or in WordPress? I know we’ve spoken about debugging and checking errors in your code before, but I’m still a bit confused about how you open the code, check the code, understand the error messages, etc. I really appreciate the second portion of the document that explained how to display the error message in a clear, director manner. Although I still struggle a bit to understand what the bug lingo means (e.g. “call_user_func_array() expects parameter 1 to be valid” is not a clear description of the problem to me, whereas something like “the code is missing a bracket” would be very helpful).
  2. The section on WordPress templates was a bit confusing to me. Based on our discussion last week, I thought we should only be adding content to the “wp-content” folder and then if we having something that is functional (e.g. PHP or jQuery) it should go in the plugins folder but then something that is more design based should go into themes. According to the reading, however, the header, footer, sidebar, etc. themes that you may want to add should end in .php – so wouldn’t that mean they belong in the plug-in folder? If it’s a template, it’s a design feature, but when why is it built with a function code?
  3. Was the “Custom Fields” reading basically describing when you scroll over an “email” form on a website and it drops down the 3 or 4 emails you have used on that account? And in that scenario, the “key” would be the email field and then the value, or values, is the 3 or 4 email addresses the computer has saved from previous entries? The example made sense, but I was struggling to understand when you would use it in a practical sense as you are likely not going to put “Currently Reading” and “Today’s Mood” into custom fields on a regular basis.
  4. Lastly, if we have time I would like to go over how to “enqueue the parent and child theme stylesheets.” I read through the description several times, and if it’s simply copying the code, as with adding a link to a style.css sheet in HTML, then I can copy the code, but I was unclear if there are certain labels/titles/lines that need to match the code I write.