I spent most of this week working on creating a custom metabox and custom fields for my site. As I mentioned in last week’s post, I created a custom post type plugin to log all of my runs. I was able to create a custom metabox called “run details” with three fields — neighborhood, date, and time. However, I’ve been unable to get the data that I enter into the custom fields to save and echo out to my post type. I even rewrote my custom post type plugin according to the reading list example Greg showed us, but haven’t been able to get the data to save. So I now have two versions of the same plugin written in different code, but both have the same issue. I spent more than five hours troubleshooting this on Friday night, but to no avail. For now, I’ve moved onto styling my child theme in CSS. I did figure out how to get my custom posts to show up on my homepage, which was one of the questions I had last week.
I played around with adding this Strava plugin to my site, but the reviews for this plugin mentioned that it is not mobile-friendly. I confirmed this fact when I downloaded and installed the plugin, created a test post using the suggested shortcode, transferred the files to my live site using FileZilla, and then pulled up that specific post on my phone. The reviews were (sadly) correct — the table showing the data about my run bled out of the area of my post, and looked really bad. Because there are very few Strava plugins out there, and because this flawed plugin was the highest-rated and most often downloaded one, I decided to instead use the shortcode provided by Strava to insert a text widget into the main sidebar of my site. I did this on my local site to see how it would look, and then went ahead and added the text widget to my live site. I know this doesn’t count as a code modification, but having my Strava account linked in some way to my site was a very important part of my project. Perhaps the addition of this widget can count under the “content” grading criteria instead.
I’m likely going to have to abandon my plans to create a lightbox photo gallery due to the fact that I’m running out of time to work on this project, but I’m still hoping to build a featured post carousel onto the homepage of my site. I’ll also be writing some content so that I can have at least five posts on my live site.
I’ve been loading my plugin and theme files onto my live site via FileZilla. It’s so exciting to see my changes show up on my live site. I did have a minor snafu when using the FTP server the other night. Something happened when I was replacing my CSS file, and when I refreshed my live site, all of my styles had disappeared and my site was showing up in Times New Roman with bulleted lists. I may or may not have cried for a few minutes. I had to delete my child theme files from the remote server and then re-upload them using FileZilla, and that fixed the issue. Crisis averted. I’m hoping not to have any more scares like this before the August 6 project due date!