Tag Archives: week9

APIs and Building My First Plugin

I had heard of APIs before taking this class, but this week’s readings and videos did a good job of breaking down this complex topic. The kitchen analogy used in the “What is an API?” video was helpful in terms of understanding how an API works as a messenger that communicates user requests and delivers responses back to the user. I recently booked a flight using the online travel service Kayak, and did not think about the fact that Kayak was using airline APIs to find me flights based on the parameters I defined. Kayak accesses the airline APIs and aggregates information from them based on user requests.

I also tried out one of the examples provided in the video about REST APIs. I typed the sample URL into my search bar and tweaked it for my hometown of Mendon, Massachusetts, which resulted in a page written in JSON that allowed me to access the GPS coordinates for my hometown (latitude: 42.1056525, longitude: -71.5522859). I then went to the main Google Maps site and entered these coordinates, and was taken directly to the center of my hometown on the map. I will have to do a bit more research on the topic of APIs in order to more fully understand how the concepts can be applied to WordPress. I imagine that APIs are probably used in a lot of plugins that access data from outside websites, such as those that pull in data from Twitter or Instagram feeds.

I spent this weekend working on the modifications for my WordPress site. As I mentioned in last week’s blog post, I was able to create my child theme and activate it on my local site, but I still have to play around with the fonts and colors of the site. I plan to do that towards the end of my project, once all of my other modifications are complete. One specific question I had regarding editing the styles.css file for my child theme is, how do you edit the fonts if your parent theme uses the Font Awesome toolkit? For example, I tried changing the font for my site header, but it is not working, and I’m thinking it’s due to the fact that my parent theme uses Font Awesome and thus has multiple CSS files. How do I change the fonts in this case? 

I also decided to tackle the custom post type modification by building a custom post type plugin. I was able to write the code for this plugin using these instructions, but ran into a lot of issues on the way to getting it to work. For example, when I tried to activate the plugin from my wp-admin panel on my local site, I kept getting the following error:

Parse error: syntax error, unexpected ” => array(‘ (T_CONSTANT_ENCAPSED_STRING), expecting ‘)’ in /Applications/MAMP/htdocs/finalproject/wp-content/plugins/therunningglover-run-post-plugin/therunningglover-run-post-plugin.php on line 18

I could not for the life of me figure out what the issue on line 18 was, and so back to Google I went. Luckily, the Stack Overflow gods were there to help out, and I figured out that I had forgotten a single quote (‘) on line 18 of my plugin code. I fixed the issue, refreshed the page, and the plugin was activated. However, the custom post type was still not appearing in my admin panel, and so I decided to go back to square one and rewrite my code using the steps listed on the WordPress codex. I got it to work within five minutes. Lesson learned — use the WordPress codex first. I now have a custom post type on my left admin panel called “Run.” Now I’m working on adding a custom metabox called “Run Details” with metadata (custom fields). One question I have is, how do I get my custom post type posts to show up on the home page of my site, rather than just under the Blog page?

This coming week, I want to download a plugin for Strava and see how I can use it to pull in information about my most recent running routes onto the sidebar of my site. When modifying the code of an existing plugin, do we need to create a “child plugin” (if that is such a thing)? I will also attempt to build a lightbox slideshow to display some of my photographs, but may end up using a plugin for this. I’m also planning to load some of my files using the FTP client later this week, to ensure everything is working correctly on my hosted site. I’m feeling a bit overwhelmed at all that I have to do in the next week-and-a-half, and am hoping that I can at least get three quarters of my proposed modifications done before the final project deadline.

Regarding GitHub, should I only be syncing files that I’m coding myself? For example, the plugins that I downloaded and added to my page from WP also synced to my final project GitHub repo. Should I remove the code for these plugins from my final project repo since these are not something I coded myself? If so, what is the best way to do this?

Beginning work on Final Project

We were talking about the readings about API and although it helped us understand how the web works, we’re not exactly sure how it applies to our projects or if we need to add it to them. However, through the readings I was able to understand the purpose of an API and how websites like Facebook and Google are able to get and provide the information and data that they do. The only real thing that I didn’t understand about API was REST API and the JSON aspect.

I have officially began working on my project. Unfortunately there has been a minor setback in that my database is not hooking up on my local server with my folders. Therefore, I am stuck trying to get things to work and worried about erasing my database as a whole. I’m not exactly sure why because it was working the other day in class, and of course when I get together with Jaclyn and Lucy to work on the project now it won’t work.

Back to the project, I am getting nervous that I will not be able to completely understand everything in order to get things done. I need to do some research tonight into WordPress and how to make changes to it.

A few questions that I have are :

  1. If we are adding an HTML element where would we place that code?
  2. If I am making changes to a plug-in, which folder within the folder do I make changes? And with that, do I have to make a plug-in child?
  3. How do I fix my database problem?

Overall I’m hopeful that I will get everything completed but am getting frustrated that things aren’t working in a way that I can even get started, and that the week before our final is due we won’t be able to have hands on help if we truly need it.

FTP Sadness

FTPs are the worst. They really are. FileZilla, after I spent 30 minutes trying to get from step one to step two, it kind of made sense. I understand why they exist, I understand (now) how to use them but I don’t like them. I did not understand how to use it until I watched the video. Also why are the instructions so complicated? There is no need for all of this!

Why did they make it so complicated? And, yes there are a lot of files but would it crash the system if I just transferred it directly into cPanel? There are just so many systems and so many new applications with unclear purposes that the actual joy (is there joy in this?) in the process.

Safe to say I did not like using FTPs. It was very frustrating, needlessly so. The instructions were very unclear and unspecific that it took so much longer than I thought is should have to actually get the program going. Really did not like this. And I transferred the entire folder into public_html in cPanel and it wouldn’t work. Apparently there was one folder too many for them. Again, very frustrating process.

Is there an easier way to do this or a more straight forward program to use for this? Would it be a good idea to use a different one for the next class?

At this point the site is coming along. I’ve been fighting with php for awhile to make my contact form work. I’m close to just finding a plugin and editing that but since most of what I want to do is front end, that might work.

Finishing the project doesn’t mean the end

I am having a flashbacks of error messages from COBOL. The solution is exactly the same for all of them: google what the error code is or what you want to do. Almost every time, someone has been trying to do what you are doing, and has documented failures and successes. It is  encouraging because you don’t feel alone, but also discouraging because you feel that you are trying to slam through a brick wall with your head; it hurts.

I am looking back at my thoughts from the first classes of the semester, and I am not seeing the kind of results that I had optimistically (naively?) put my sights on. But even with not being quite what I wanted to have at the end of this process, it has taught me that this isn’t the end. And that’s a good thing. I remember stating earlier that I didn’t like some previous projects that have lain dormant after the end of the corresponding semester, and I am confident that I will continue to tinker with this puppy until I get it perfect: that is to say, never! This also brings me to the issue of between midnight tonight and class on Tuesday, I will still be working on it to try and keep improving it, I hope Greg doesn’t mind!

I am learning that I don’t really want to be a “web genius” like Zuckerberg or Wozniak, because I do still want to be the journalist writing for the public, rather than one of them writing behind the scenes and changing our online lifestyles. It is laudable, but I want to be finding the stories that people read and get engrossed in. This by no means changes the fact that I find this class extremely interesting and fulfilling. I am so glad that I can now control my own online presence instead of dictating needs to someone else without knowledge of what is occurring. I find it detestable to not know how something works, and that is what will keep me employed as a journalist, and this class makes me even more valuable to would-be employers.

My final project has gone through several facelifts, and I am pleased with how it is shaping up, but I do not think that it is my vision yet. I do not think that it will be there until I completely work out some issues with the Twitter idea, the way for the blog to situate itself, and other ideas I have. I have come to the concession that I will probably find things I want to change about it every time I look at it.

Coding Under a Deadline

To say that I should have been coding a lot more along the way is an understatement. I focused more on the content of the site as I received it and I think they’re really great pieces. There’s nothing like a deadline to push you to code briskly and checking your work along the way. After crashing my site by messing up a few lines in the functions.php file, I had to walk away from the site on Friday afternoon. It was getting to be a bit much and I felt like my jQuery-hating self again. Oftentimes, the best thing you can do after much frustration is to walk away from the site for a few hours. Clear your head and come back to the code and really go through it with a fine tooth comb.

I took a little more than a few hours and really got myself mentally ready to engage in a full day of coding and content creation. The site visually I think is awesome compared to the bare bones it was a few weeks ago. I’ve seen the site come a pretty long way and I am proud of what I have been able to learn and code. It wasn’t without the help of Codecademy to remind myself of punctuation and proper order. My biggest appreciation for what this class has taught me is literacy. I remember looking at .php files in WordPress and not knowing what did what and how. I’ve now been able to dissect pieces of codes and understand what it does based on context. I won’t claim intermediate proficiency in my professional life. This, however, was never the goal and my ability to understand code and the website creation project lifecycle is a very valuable asset to have as a marketer.

There are few loose ends to tie before the midnight deadline. Mostly exporting my content from the local site to the live site and making sure everything looks in order. I can’t wait to see everyone else’s projects and get another perspective on my own to strengthen the final product. See you all Tuesday!

Not so finished finish line

I have made a lot of changes to my site from WordPress admin and I’m excited about all that I’ve learned about WordPress. Going into this class, I’m realizing I knew very little about WordPress and learning all of its capabilities was a really cool process. Code on the other hand has kicked my butt for the most part and I’m pretty sure I’ll be extremely happy when I’m done having to do it.

The good thing is that the majority of what I wanted done for my site has been completed, minus learning how to code. I’m starting to become a professional copy and paster and I’m so grateful for all of the coders that have so graciously put out the codes that they felt best worked for them. What I’m not so happy about is that I don’t really feel like I know how to code per se. I believe there are far more things that I don’t understand than those that I do. Regardless, I’m happy that I will leave this class with a site and that’s what I ultimately wanted to get out of it.

I have not finished my site, and am a little nervous about what you’ll say but looking forward to seeing everyone else’s site and the progress that they’ve made. I think the main thing that I’ve learned from the course is that coding requires google and a lot of it. I’ve used Lynda and google like crazy but the huge problem is that it takes up so much time watching and learning and once it doesn’t work, it’s become 2:00 a.m. in the morning and I’m completely defeated. I have made a lot of progress by watching online tutorials, but I think I’ve learned more from those than in-class. That is not a jab at you at all, but I think I’m more of a visual person and I needed a lot more run-thru’s than what we received. Hope you like my site!

Done?

It feels pretty good to be coming up on the deadline for this project. Without a deadline — and this goes for all projects of mine, not just coding ones — I’m prone to second-guess myself and keep changing or adding into eternity. Having a set date when we were meant to be “done” with our site means I had to reach a point where I was happy enough with the site to call it finished.

But, because my site functions as a personal portfolio, I’ll never really be done with it — I’ll keep adding elements as I complete work I’m proud of, and deleting others that start to feel elementary as my skills improve. I’ll change the design as trends and technology evolve, and I might even add a new page or two if a career move or personal project demands more space on the site. All of which is to say that, although the deadline hits in just over four hours, I don’t really feel the sense of relief and pride that I usually get when I finish a project at class or work. I do feel excited by what I’ve learned and what I’ve been able to do, but more of my mind is focused on what else I want to do with the site once this class is over and I have some more time to put into it.

Most of my work this past week was spent on finishing touches, which, for me, meant adding more content to my posts. I spent way too much time sizing and positioning images in my “Clips” section, and I’m still not happy with how they stack up as screen size shifts (which is especially relevant for mobile optimization). But all in all, I’m pleased with how the site looks and I kind of can’t believe I figured out how to change the theme to suit my needs! I’m really looking forward to seeing everyone else’s sites on Tuesday.

Honest Assessment

I originally posted kind of a downer post, but after reading everyone else’s, I decided to try again.

So I think this week I did a lot with my site. I began with some basic css code to clean up the TwentyTwelve theme. I got rid of all the extra words on the theme, to include the text around the comments box, the “categories” text, and even the “Powered by WordPress.” (Sorry WordPress). Once it was clean, I started to look for ways to make the site styling more personal. I found a pretty nice code example for a home page and copied that into my stylesheet. That allowed me to take my clean theme, and start to build a “display case” for my photographs. Initially, I had some functionality issues, but through some tweaks and Google searches, I was able to clean it up.

Once I had the display figured out, I started to add some “functionality.” I encased that in quotes, because I may be misusing the term. I basically made the site comfortable to browse. I wanted the viewer to feel like they were a guest, and that I was sharing my life experiences with him or her. So I used my widgets and menus to guide them through the site as if it were a scrapbook sitting on their lap. However, I tried to do that without compromising the cleanliness of my site.

I added a small Twitter feed on the sidebar, and included an interactive world map that called back to locational tags I created for each photo. I also created a custom contact page, with personal error messages in case a user got it wrong.

Hmm, what else? I definitely customized the look of the header, and removed it from all pages other than my home page. I eliminated borders around photos, and set up permalinks that were a little “prettier,” as they are described.

All-in-all, I learned to use plugins, widgets, and menus to build my site the way I wanted. Then I created five or six unique pages in my child-theme to add the extra functionality and look that WordPress couldn’t provide. Honestly, I got the impression that I hadn’t done much, but I think once Tuesday comes around, my work will come through. I did bust my tail on this site, and I am very pleased with how it looks. Like others, I think I too will continue to make improvements. However, considering where I began, this is quite an achievement in my mind.

For those who may have read my first post, please disregard. 🙂

“See” you Tuesday.

 

Speechless

Counting down the days and hoping for a miracle that will address my local site to live site sync issues. Not to mention my inability to see past the hurdles.

This course has been quite the adventure. I wish I could say that I have the key concepts down, but I still feel all over the place. I hope to continue learning and strengthening my knowledge of WordPress with the hope of one day seeing the light and laughing about all the hours which I have dedicated to figuring out customer posts, and taxonomies, etc. I feel that I am confused with the subject matter as a result of being able to include the same functionality from the admin site. At least that is how I see it at the moment, but I am sure that as I learn more I will understand the reasons why it is good to learn how to create custom taxonomies. I read several blogs, which speak to the benefits, but I cannot say they have convinced me and/or that I even understand what they are saying. What a humbling experience this has been.

On another note, this class has helped me get a step closer to what I definitely do not like. The subject matter is interesting, but the tradeoff between the time I spend trying to figure things out and how I feel when I figure it out are just not aligning to something that I want to continue learning and pursuing. The only reason why I would want to continue learning about development and WordPress would be to help small business owners establish an online presence. Then again, I can probably just find someone that does enjoy this type of work to help.

Looking forward to seeing everyone’s creativity this coming week. Good luck everyone.