Category Archives: 2013 Summer class

My first plugin and custom post type

Knowing that I want to have custom post types for different types of content, I set out finding the best way create custom posts.  Plugins seem to be the easiest way to add custom post types, but the WordPress codex didn’t seem to give me all of the answers I needed.  I was understanding how some of the code worked, and that it needed hooks.  I wasn’t entirely sure what code to edit or whether I should make new files or change existing ones.  I didn’t know whether this was a content or an admin issue, as the posts usually come from the dashboard.

Plugins made this simpler, as I discovered that I could just make a whole new file in wp_content/plugins, and not be at risk of screwing up any of the other files.  I also decided to look at some examples and use a template of some code, just so I could get something working and not have to start from scratch.  There are so many pieces to custom post types; it really helps to look at what some other people have done in order to get it working right.

After following the WordPress codex and a great article about plugins and custom post types I saw here, I was actually able to see my plugin, working, on my local site, which felt like a big accomplishment after spending hours reading and looking at tons of code and step-by-step instructions.  I activated the plugin and saw my custom post type show up in the sidebar, allowing me to click on it and start typing.  Although it currently has the same functionality as the regular post, I’m exciting that its working.  Now the next step is to learn more about meta-boxes and figure out how exactly to get my custom post type to do what I want it to do.

You have to love time savers

Although I have not yet memorized even a quarter of the commands that exist, I have a way better understanding of command lines and why they would be used. I even read from the assignment that there are ways to make changes to all of your folders at the click of a command, saving tons of time. When Greg first introduced this to us, I was confused on how web development and these commands related to one another. If I understand correctly though, we could essentially access and change files even in our WordPress folders and at a much quicker rate if we have a similar thing to change in all of them. Needless to say, anything that eliminates extra/unnecessary time has a good rating in my book.

For my site, I am currently in the works of adding a widget for my Facebook and Twitter account. I have not made any local to live updates yet, but I’m hoping to do so tonight after I CORRECTLY add this (crossing my fingers). For this week and hopefully even tonight, I plan to add the widget and I’m considering a taxonomy plugin.

One issue I’m having is I’ve noticed the example provided of my theme differs a lot from how my theme actually shows up. I chose this theme because it placed the slideshow right in your face, but it also showed feature stories on the right side of the page. I like it because each story had a a picture adjacent to it and it reminded me of a more professional news site. Now I’m trying to figure out if that’s something that I will have to add in through coding or the admin page. I will update this post when I finally get my plugin to work.

 

Wonder what my potbelly junior high science teacher is up to now?

When I was in 7th or 8th grade, our science teacher pulled up this TV screen with green letters and numbers on it. He said, “This is a computer.”

We all stared and blinked. He continued, “No, look it’s really cool. You can make it do things for you, like count to infinity.”

We spent the next 20 minutes or so typing random letters and numbers into the black screen (or watching him do it anyway), and to our lack of amazement, the machine started to count. Over the course of the next week or months (I don’t remember), the machine counted on … and we went about our lives. It may still be counting; I’m not sure. But that was my introduction to code.

It took another decade and the invention of AOL chat rooms for me to get interested in computers, so I missed out on the evolution – the result of which a very slim screen is displaying in front of me now! Amazing (I wonder if this thing can count to infinity?). Anyway, that brief introduction to code always gave me an appreciation of what mysterious numbers were working in the background of my computer programs. I knew there was something more, and even as we’ve learned these new concepts in class, I appreciate how it all shares common ancestry.

The problem is, much like when I was 12 years old, my interest in learning to make computers do what they do is limited. I definitely enjoy knowing how things work, but just the wavetops.  I like knowing just enough to be dangerous. The good news is I am confident this class will get me there. Despite all the frustration in trying to grasp the concepts, the worry about getting a low grade, and the reality that most of the details will be forgotten in a couple of months (let’s be honest, weeks), I think the exposure will leave me in a very similar state to my first code “exposure.” I’m sure the next time I see a web developer working on something, I browse through a site, or tweak my own, I’ll have a deep and healthy appreciation for what’s happening in the background. And after this class, it will be an appreciation for more than just the MS-DOS.

As for APIs, well I’m getting there. It seems most of the articles are written for people who have at least a little experience with web development. That makes it tougher for the beginners I think. I’m going to start cutting and pasting stuff into my site though, and see what happens. Maybe I’ll create a web page in my science teacher’s honor … one that just keeps on counting. He’d be so proud.

Lost in the Sauce

I knew that missing a class would leave me a little behind, especially in this class. However, I felt completely lost when I started to read the e-mails that were stacked in my inbox for me when I returned from overseas. The blog posts left me even more confused. I really feel like I missed an entire semester. The good thing is that after reading ALL of the blog posts, it because apparent that I wasn’t the only one lost. So in a pack of hunting dogs, I’m going to be the red fox that looks forward and shuts up. Hopefully I’ll blend in until I catch up.

What specifically confused me was just the apparent advancement everyone seemed to make on their personal sites. You all really seem to be pushing ahead. I think by the end of tonight, I’ll be completely caught up with you guys … and by that I mean I’ll be totally lost in my own site. 😉

It seems difficult to decide whether to create a functioning site first, and then tweak it, or try to create a very personal site first. I think I’m going to go with the former, and construct a very basic stie with the WordPress Twenty Eleven theme. No changes, just a flat out copy and past of my information into the theme. Once I do that, hopefully I can go back in and start to change things. I just want to see the site up and running, knowing I made it through the MAMP, CyberDuck, and other program problems, before I start experimenting.

I have actually set up a WordPress site before, through the .org service, and I enjoyed all of the personalization that was available. I think I can catch back up on that quickly, and then start to play with the coding behind them. The funny thing is, I’m guessing the first few changes I make in the HTML and CSS will be things I could have changed just going through WordPress’ personalization menus. We’ll see. Perhaps I’ll have to come up with things that are a bit more complicated.

Terminal

Terminal seems like a function that can really make a web developers life easier. I would actually like to learn more about it as it seems to cut down on the number of sites and folders one has to logon to complete a function. As I went through the GitHub Terminal tutorial, I started feeling more comfortable with the functions and was very impressed by what it can do. The one gap that still remains in my mind is:

How do I start using it to submit updates to files for my application? To create branches?

Does one logon to GitHub, or does the terminal recognize a command and automatically update the file based on the command entered?

Exciting News

My site is starting to look like a site, but I must admit all the changes made thus far have not required changes to code, that is next. Using the admin site to make updates has once again motivated me. Now, I just need to take my motivation to the next level and start updating code, specially moving the menu on the right side to the bottom of the page. Well not all fields only some.

My goals for this week are to update the following on my site:

– Include a Flash plugin, find someone and/or figure out how to complete an animation which I can post to my site, upload images, create a custom post.

– As far as custom posts, I will be looking into Custom Posts tonight while on my flight back to D.C and deciding if I want to use them on my site. As of right now, I think custom posts will be useful, but I need to look into them prior to making a decision.

Overall, I am so glad for the WordPress Local Site admin menu. Thank you admin menu for helping me regain some motivation.

 

 

From Local to Live

I have been spending so much time on my local site that I had forgotten it wasn’t my real site! I wanted to make sure I understood what this website project entailed, every step of the way, so I decided to export what I had accomplished thus far onto my live site. Sounds easy enough right? I opened up CyberDuck and dropped the files in the correct folder. Next I went to Tools and then Export on my local site. All seemed to be working correctly. I signed into my live site (by some miracle I remembered my username and password) and again went to Tools and then Import. And here the problems began.

First of all, none of my media files had transferred. This meant my header and background were back to being the plain, gray, twenty twelve theme. This was slightly irritating but easily fixed. Next I noticed that the words on the main navigation bar were back to not being centered. This was the most frustrating part of the export/import process because I had spent so long last week, as well as last class, figuring out how to make them centered! Some of my other css style edits came through but not the centered words. The menu also refuses to display what I want it to even though everything is set up exactly as it is on the local site and everything on the local site works. Needless to say I’m glad I figured this out now and not in two weeks!

Having found little success with going live, I decided trying out custom post types might be a more successful venture. Unfortunately, every time I tried to make a plugin or change the functions.php file, the WordPress admin page stopped working. While it was not quite Susan’s white page of death with an error message, I found it irritating enough that I also deleted my attempts in order to restore a working WordPress page.

The readings were good this week in that I felt they helped me build up my understanding of what I was trying to do, especially the Smashing Magazine article. Hopefully next week I will have more luck executing this understanding!

WordPress White Screen of Death

This weekend I was determined to create a custom post type (CPT) for my wine website. My initial plan was to create the CPT as a plugin, since that’s what Greg recommended. It turns out that’s a little more complicated than I thought it was when we went over the concept at 9:15 p.m. last Tuesday. I browsed the Codex for a refresher and did many Google searches, but unfortunately I couldn’t figure it out. So I moved on to plan B and placed the CPT code into my functions.php file. Once that step was complete, I connected to my local server and checked my WordPress admin panel. It was a miracle…my new “Wine” CPT button was added right below the comments button.

This was a great accomplishment, but having the CPT only display on my local admin won’t do me any good in the future when I want to add content. So I decided to commit/sync and drag my updated functions.php file into Cyberduck in an effort to get my CPT to show up on my web admin panel – piece of cake, right?

Wrong. After Cyberduck was finished downloading, I refreshed my website… and screamed because the screen turned white with a fatal error message. This was the first time I received an error message of this magnitude, so I was freaking out. But instead of throwing my laptop across the room, I deleted the functions.php file from Cyberduck, and that apparently fixed the problem. But, I’m still without the CPT on my web admin menu.

Sidenote: I found this handy “Common WordPress Error” resource page in the Codex, which I will now be bookmarking.

I want to revisit plan A – creating the CPT as a plugin – but I plan on doing some additional research before experimenting again on my site. For now, I will continue making style changes in the css and gathering content that I plan on incorporating.

Command Line
I have to admit, I was a little skeptical about learning command line. Isn’t clicking easier than typing? But after actually going through the motions in class and browsing the readings, I understand why command line could be very useful in some situations. In my job, I often have to convert image files to different formats. Sure, clicking a button or two to convert one image is definitely faster. But, what about 1,500 images… in a short period of time? Typing a command that’s a few lines long would be much more efficient.

APIs: The Key to a Fast Site Build.

APIs were a bit of a taboo for me up until this point. The guide we were given in between these weeks have been really insightful. It was a little dense with information but I found great use out of it. When I was job searching earlier this year, I would steer clear from positions that asked for an understanding or listed required skills in programming, CSS, PHP, and understanding of APIs. I came to the realization that I have been using APIs for a pretty long time through the use of Twitter’s API, Facebook’s API, and lastly Instagram APIs to pull tweets, Facebook friends, and photos I’ve shared and post them on my personal website and those of my clients. I quickly realized this when it discussed authorization keys and how I’ve struggled in the past in finding them through my accounts by going through the website’s developer section. APIs are not the easiest thing to understand, but well documented sites like the ones listed above do make it easier.

I plan on using APIs for my website by the way of an Instagram or Flickr API to make it easier for my family to generate photo content while she is out in the field. APIs will help facilitate substantial portions of my project website in the form of portfolio items. I’ve made substantial progress on the website locally through the admin menu. I have a pretty good outline for the website and I’m looking to limit the website to about five pages. Home, Services, Testimonials, Portfolio, Contact Us. Should I be able to condense certain pages like Services and Testimonials in a way that makes sense, I will. My current struggle is getting images, colors, and etc. agreed upon by my family and I. My mother specifically enjoys bright colors and so finding colors that will be good for user experience has slowed down progress just a tad. I sometimes encounter these same issues with some clients, primarily ones that don’t have an established brand identity. Once I get over this small hurdle the Twitter and Instagram APIs should help build out the rest of the site rather quickly.

Fear of Commitment

I’m having a fear of commitment issue. I know how I want my blog to look, but I’m having trouble vocalizing it, and even more trouble trying to figure out what theme would be the best launching pad. I’m afraid that if I commit to a theme that I later do not like as much as another one, I’ll be stuck.

I’m very excited to keep working with WordPress. I’ve spent a good amount of time going through the themes and beginning to lay out my plan.

What I’m most excited about having learned are the possibilities in general that a site can do. I need to keep myself narrow-minded, though, and focus on certain things and not all of the foreseeable possibilities.

—–

I just finished the assignment to try and create / install a child theme. Consider myself filled with a million new questions.

Anytime I feel remotely confident about something learned, that confidence lasts less than 24 hours until something reminds me that I know nothing. I feel like Jon Snow:

I’m even finding directions confusing at this point. I tried following the WordPress directions on how to create a child theme, and I’m not even sure I did it properly. I’m also not sure how much stuff I was supposed to change, but I tried fixing a few things that I don’t like on the current theme.

The guest speaker from last week was helpful in terms of showing us what is possible with WordPress, but the material was covered so quickly that at the time I thought I understood, but now that I’ve had a week to sit on it, I’m not so sure I can replicate anything that he did.

Actual, factual results

I like that we are beginning to see results on our own webpages, because the conceptualization can only get you so far. I feel like we have learned a new foreign language (or several!) in a short period of time, and only now are we starting to talk to anyone in those languages.

One of the greatest skills in a work environment (like mine) with coders and management is the ability to be a liaison between the two. Seriously. Coders talk in these funny languages and everyone else talks in English (or French, or Spanish, etc) and usually neither side takes the initiative to try and understand the other. The ability to understand “code-speak” and translate it into real results is a highly valued commodity, and I think that this class is beginning to make it a reality for us.

In my normal coding experience, we specialize so deeply that once we send the code to production, we simply move onto the next project and rarely see the end result. To be honest, I have never really cared because all of the work I do refers to life insurance accounts and how their algorithms work. It has never really engaged me more than the simplicity of my work, and I have always wanted to get out of that business (hence journalism!), but with this class, it has brought me back to why I started learning about computers in the first place. I am very excited about what we are doing, and have already been envisioning building the website to host several things that can be related to a new business and journalism at the same time.