wordpress posts page 2

WordPress plugin: changing rel-canonical

I serve my site over both HTTP and HTTPS to support older browser that can’t support modern or any HTTPS protocols. I prefer HTTPS for search engines and general use though, as it is more secure, increases user privacy, and is factored into SEO rankings. Due to an issue with my sitemap, Google ended up indexing all of my blog pages as HTTP. The first thing I’m going to try to get Google to show my blog pages as HTTPS is to set the rel-canonical link to the HTTPS version regardless of which protocol the visitor uses. WordPress doesn’t have a built in way to change the canonical URL, and I didn’t want to install a heavy SEO plugin just for this, so I wrote my own.

This simple plugin removes WordPress’s rel_canonical action, then replaces it with its own. I basically re-implemented WordPress’s own functionality, replacing the http with https before outputting the link. It looks like:

Continue reading post "WordPress plugin: changing rel-canonical"

I was using Jetpack’s sitemap plugin and even submitted it to Google until I noticed that it had the wrong protocol for all of the post URL’s. Now Google has a bunch of ‘http’ URL’s for my posts in its listings, even though they are available over ‘https’. I couldn’t figure out how to change the protocol (there is no config or documentation about where that is coming from) so I just disabled the sitemap for now.


WordPress code plugin, a quick solution

I’m slowly copying the markdown versions of my posts after my recent move of this blog. It really is tedious, and I don’t think I’ll finish anytime soon, so in the meantime I created a plugin to output the [ code] shortcode that wordpress.com put in my post export in the same way that markdown does. This is the first plugin and shortcode I’ve created in a long while, but it was relatively quick to do working off of my posts on plugins and shortcodes. The biggest time consumer was figuring out how to deal with whitespace issues. Apparently, WordPress sometimes will add <p> and <br /> to shortcode content. Also, there were leading and trailing line breaks adding unnecessary space. My quick solution:

Continue reading post "WordPress code plugin, a quick solution"

Blogs moved and merged

This weekend, I moved my wordpress.com “professional” (web development) blog and my “personal” blog both to my main website and merged them together. I had been planning on moving my blog from wordpress.com for a while, but recent problems with writing posts with code blocks pushed me to finally take the plunge. I’ve also been feeling like maintaining a separate personal and professional site might be more trouble than it’s worth. I do worry that the different sort of audiences that would go to the one wouldn’t want to see the content from the other and vice versa. I might be less inclined to write some personal stuff on my professional blog. But I think I will be able to find ways to mitigate those issues and make it work well.

Both sites are now redirecting to my main site. I had to pay wordpress.com ($13 a year) for the privilege, but I think it is worth it considering the “link juice” I have with that blog. I will probably continue paying for at least several years. With the use I’ve gotten out of WordPress so far, they’ve probably earned it.

There are still some things to fix:

  • The content imported from my professional blog didn’t bring over the markdown formatting, and thus all of the code blocks are messed up. I am going to have to manually copy them over one by one from the wordpress.com admin as far as I can tell. A pain.
  • I accidentally deleted all of the media files imported from the wordpress.com due to the way I deploy my site. I’m going to have to reimport on a local install and upload, then make sure my deploy ignores that directory. Hopefully the redirect I set up doesn’t cause problems for this.
  • There is plenty of non-blog content on my personal site that I will need to move to my main site. I don’t have any real “link juice” with that site, so I can move things wherever I see fit or not copy it at all if it doesn’t seem worth keeping.
  • The theme is just a slightly modified ‘twenty fifteen’. I’m going to have to decide what I want to do with it to better integrate it into the rest of my site.

My eventual plans are to move my blog out of WordPress and into the same system I’m using for the rest of my site. I may lose some things in the process, including possibly my connection to the WordPress project, but I will gain control.

I had a number of problems during my move, but am way too tired to write about them currently. Hopefully they’ll make for a few posts this upcoming week.


Givecamp 2014: Lake Erie Ink

Lake Erie Ink mobile home page
Slightly over a week ago, I finished my fourth Cleveland GiveCamp. GiveCamp is a weekend of developing websites and other things for area nonprofits. As usual, it was a good time. My project this year was an update to Lake Erie Ink’s site. They had actually had their site built at the GiveCamp two years prior (I was not on that project, but know someone who was). They just wanted a map added to their site that showed where kids were writing or writing about. With six developers and a developing project manager, along with a WordPress plugin, we were able to get the basic functionality working rather quickly. So quickly that we had something working Friday night and started shedding developers to other projects. By Sunday it was basically down to just me and the project manager (plus the Lake Erie Ink people, of course). We added in some extra improvements in addition to the map. We brought in a couple of designers for brief stints to help us with some design issues.

For my part, I did help some with the map, but spent most of my time making their site responsive and tweaking the home page to include a callout for the map page. The site had not been designed with responsiveness in mind at all. It had nested divs with fixed pixel widths that accommodated padding of the parents’ even when width: 100% would’ve done the same thing. In addition, id’s were used a lot, even multiple times per page, there was a lot of unnecessary redundancy and extra CSS in the styles (such as repeated blocks and things like margin: 0px 0px 0px 0px), and extra heading elements were made up to provide extra heading styles (h7, h8, and h9). The templates were confusing at times and some had different versions or nearly identical related templates.

Continue reading post "Givecamp 2014: Lake Erie Ink"

The Happs

It’s been a few weeks since I’ve posted a Happs or any blog post. I think a lot of the things I want to post about, I want to post a dedicated post, but that doesn’t always end up happening.

Conferences

The weekend before last, I went to two conferences. I took notes, which I plan to post once I get them digitized and cleaned up. I enjoyed the conferences even though having both in one weekend, with one in Pittsburgh, was a bit tiring. I went to Rustbelt Refresh and Pittsburgh Tech Fest.

Rustbelt Refresh

I had gone to this last year (the initial year) as well. I was pleased with the talks again. It’s a single track, single day event on general front end development and design. It brings in some of the “celebrities” of the industry. This year included Karen McGrane and Jeremy Keith, for instance, and last year had Eric Meyer (our local web “celebrity”) and Jonathon Snook. It is definitely nice to be able to hear talks by some of the people driving the thoughts in the industry. I had a good time, the talks were good, and I learned some things or shored up some ideas I already had.

Continue reading post "The Happs"

The Happs

These happs blogs don’t always allow me to go into as much depth as I would like, but they are definitely a lot easier to write. I have been writing much more frequently now that I’ve started them. “Remember, a writer writes, always.”

WordPress Starter Theme

After much time and effort, I’ve finally released my WordPress base theme, TJMBase. It is the very bare parent theme for what my website has been running on for several months now. These days, I don’t use WordPress for very much, but I have done several projects with it, especially earlier in my web development life, and to some extent still like it.

Years ago, I had made a theme starter that was basically bare of any styles and extra fluff, the kind of thing you might want to start with if you wanted a good starting point for doing a theme basically from scratch. I never released it (didn’t release anything open source at that point), though I did use it for some projects and let at least one interested party use it. I had stopped doing much with WordPress once I got my current job, but I did want my theme starter to be useful to the community. WordPress 3 came out and brought some important changes that made my old theme behind the times, missing some important features.

Continue reading post "The Happs"

WPThemeHelper, my helper for WordPress themes

In remaking my website using WordPress, I’ve been working on a base theme that I can use for other sites. I decided to take some of my experience from the Symfony world, such as organizing functionality into namespaced classes, grouped into “bundles” of functionality that can be (somewhat) independently installed as needed depending on the project. I already mentioned the PHP-BufferManager I’m using in a previous post. I’ve also created a more specific to WordPress project with more varied functionality, a theme helper called WPThemeHelper.

The theme helper has several classes to help make theme development cleaner and perhaps a bit easier. The readme on github has more details, but some of the more important ones are:

  • SettingHelper: Allows setting of WordPress settings with a map (associative array). It calls the appropriate WordPress function at the appropriate time in WordPress’s initialization cycle. Helps clean up the ‘functions.php’ file and makes remembering what functions to call for various theme settings easier.
Continue reading post "WPThemeHelper, my helper for WordPress themes"