Category Archives: wordpress

On this page:

Publishing WordPress thumbnail images using Emacs and Org2Blog

I often include large images in my blog posts since I use sketches as another way to think out loud. I’d gotten used to using the WordPress web interface to drag and drop them into the relevant section of the page. I write most text in Emacs/Org Mode/Org2Blog because of the better outlining and writing tools, and then I used sacha/org-copy-region-as-html (which you can grab from my Emacs configuration) to copy the HTML markup and paste it into WordPress. Of course, I use Emacs for source-code heavy posts that make the most of its syntax formatting support.

Someone asked me recently about how to post and update blog posts with images through Org2blog, and if I had any recommendations for workflow. I’d dropped Windows Live Writer since it was flaking out on me and the WordPress web interface had improved a lot, but before recommending just using WordPress to add images, I was curious about whether I could improve my blogging workflow by digging into Org Mode and Org2Blog further.

It turns out (like it usually does in the Emacs world) that someone had already solved the problem, and I just didn’t have the updated version. Although the upstream version of Org2Blog didn’t yet have the thumbnail code, searching for “org2blog wordpress thumbnail” led me to cpbotha’s Github issue and pull request. Punchagan’s version had some changes that were a little bit ahead of cpbotha’s, so I dusted off my ancient org2blog repository, cloned it onto my computer, and issued the following commands:

git remote add upstream https://github.com/punchagan/org2blog
git pull upstream master
git remote add cpbotha https://github.com/cpbotha/org2blog.git
git pull cpbotha image-thumbnail

and tested it out on a blog post I’d already drafted in Org. It took me a little while to remember that the file URLs didn’t like ~, so I specified a relative path to the image instead. But then it all worked, yay! A quick git push later, and my Github repository was up to date again.

So now I’m back to running a Git version of org2blog instead of the one that I had installed using the built-in packaging system. The way I make it work is that I have this near the beginning of my Emacs configuration:

;; This sets up the load path so that we can override it
(package-initialize nil)
;; Override the packages with the git version of Org and other packages
(add-to-list 'load-path "~/elisp/org-mode/lisp")
(add-to-list 'load-path "~/elisp/org-mode/contrib/lisp")
(add-to-list 'load-path "~/code/org2blog")
(add-to-list 'load-path "~/Dropbox/2014/presentations/org-reveal")
;; Load the rest of the packages
(package-initialize t)
(setq package-enable-at-startup nil)

This allows me to mostly use the packages and to satisfy dependencies, but override some of the load paths as needed.

Hope that helps someone else!

More notes on managing a large blog archive: 17 things I do to handle 10+ years of blog posts

I’ve been thinking a lot about how to manage a large archive to encourage discovery and serendipity, and to make it easier to fish out articles so that I can send them to people. I started in 2001-ish and have more than 6,500 posts. There’s not a lot of information on how to manage a large archive. Most blogging-related advice focuses on helping people get started and get going. Few people have a large personal archive yet. I love coming across other bloggers who have been at this for more than ten years, because information architecture is fascinating. Here’s what I do, in case it gives you any ideas.

  1.  I set up Google Chrome quick searches for my blog, categories, and tags. This means I can quickly dig up blog posts if I remember roughly where they are. (Gear > Settings > Search > Manage Search Engines):
    • Blog (b): https://www.google.ca/search?q=site%3Asachachua.com+%s
    • Blog category (bc): http://sachachua.com/blog/category/%s
    • Blog tag (bt): http://sachachua.com/blog/tag/%s
  2. I create pages with additional notes and lists of content. I use either Display Posts Shortcode or WP Views, depending on what I need. See the Emacs page as an example.
  3. I’ve started using Organize Series to set up trails through my content. It’s more convenient than manually defining links, and it allows people to page through the posts in order too. Read my notes to find examples. I’m also working on maps, outlines, and overviews.
  4. I’ve also started packaging resources into PDFs and e-books. It makes sense to organize things in a more convenient form.
  5. I converted all the categories with fewer than ten entries to tags. Categories can get unwieldy when you create them organically, so I use categories for main topics and tags for other keywords that might graduate to become categories someday. I think I used Categories to Tags Converter or Taxonomy Converter for this. Hah! Similar Posts reminded me that I used Term Management Tools. Awesome.
  6. I manually maintain a more detailed categorical index at sach.ac/index. This makes it easier for me to see when many blog posts are piling up in a category, and to organize them more logically.
  7. I set up short URLs for frequently-mentioned posts. The Redirection plugin does a decent job at this. For example, people often ask me about the tools I use to draw, and it’s great to just be able to type in http://sach.ac/sketchtools as an answer.
  8. I post weekly and monthly reviews. The weekly review includes links to that week’s blog posts, and the monthly review includes a categorized list. I’ve also set up daily, weekly, and monthly subscriptions based on the RSS feeds. This is probably overkill (more choices = lower subscriptions), but I want to give people options for how frequently they want updates. The weekly and monthly reviews are also helpful for me in terms of quickly getting a sense of the passage of time.
  9. I use Similar Posts to recommend other things people might be interested in. There are a number of similar plugins, so try different ones to see which one you like the most. I tried nRelate and the one from Zemanta, but I wasn’t happy with the way those looked, so I’m back to plain text.
  10. I show recent comments. People often comment on really old posts, and this is a great way for other people to discover them.
  11. I use post titles in my next/previous navigation, and I labelled them “Older” and “Newer”. I think they’re more interesting than
  12. I customized my theme pages to make it easier to skim through posts or get them in bulk. For example, http://sachachua.com/blog/2014/02 lists all the posts for February. http://sachachua.com/blog/2014/?bulk=1 puts all the posts together so that I can copy and paste it into a Microsoft Word file. http://sachachua.com/blog/2014/?org=1 puts it in a special list form so that I can paste it into Org Mode in Emacs. You can also pass the number of posts to a category page: http://sachachua.com/blog/category/drawing/?posts_per_page=-1 displays all the posts instead of paginating them. These tweaks make it easier for me to copy information, too.
  13. I give people the option to browse oldest posts first. Sometimes people prefer starting from the beginning, so I’ve added a link that switches the current view around.
  14. I have an “On this day” widget. Sometimes I notice interesting things in it. I used to put it at the end of a post, but I moved it to the sidebar to make the main column cleaner.
  15. For fun, I have a link that goes to a random post. I used to display random post titles in the sidebar, which might be an interesting approach to return to.
  16. I back up to many different places. I mirror my site as a development environment. I back up the database and the files to another web server and to my computer, and I duplicate the disk image with Linode too. I should set up incremental backups so that it’s easier to go back in time, just in case.
  17. I rated my posts and archived my favourite ones as a PDF so that I’ll still have them even if I mess up my database. Besides, it was a good excuse to read ten years of posts again.

Hope that gives you some ideas for things to experiment with! I’m working on organizing more blog posts into trails and e-books. I’m also getting better at planning what I want to write about and learn. If you’re curious about any of the techniques I use or you want to bounce around ideas, feel free to e-mail me at [email protected] or set up a chat.

Do you have a large blog? How do you manage it?

WordPress: Make a sequence of posts easier to navigate with Organize Series

You might have a lot to say, but you don’t want to overwhelm the readers of your blog. It’s a good idea to break up your posts into several shorter ones. That way, people don’t have to scroll through an intimidating 10,000-word post. Sequences help with that. Write several blog posts and link them up so that people can follow the path.

I’ve posted many blog posts that belong in sequences. Some of them are presentations and transcripts that I’ve spread out across time to make it easier for people to digest. Some of them are blog posts that I’ve organized after realizing how they’re related. I used to link these posts by hand, updating each post with a link to the next one and linking each new post with the one before it. Creating one page that listed all the posts meant yet another page to keep up to date. It took time to set up these links, and I didn’t always remember to do so.

When I look at my website analytics, I find that most of the visits are to pages that are deep within my archive. Besides the suggestions from Similar Posts, I also want to give people clearer paths through the content. That way, they can learn on their own. I wanted to make it easier to manage those trails through my blog posts without needing to edit many pages.

Organize Series is a WordPress plugin for sequences of posts. I like the way you can adjust the order of posts in the sequence. I customized Organize Series so that it didn’t show the list of posts at the beginning of each post, but I kept the other defaults. Organize Series adds links to the next and previous post, and it also adds a link to a page with all the posts in the series. I like the way that Organize Series makes it easy for readers to see many posts on the same page.

To see Organize Series in action, check out the series for A Visual Guide to Emacs. It links together three of the sketches I’ve made. I can add more posts as I publish them. You can also see the previous and next links in a post that belongs to a series, like this one for Adding Color, the second lesson in this Sketchnote Lessons series. Check out the rest of my series too.

The Organize Series plugin is free, and there are commercial add-ons. I haven’t bought one yet, although I find a few of them tempting. In the meantime, I’m looking forward to adding more series as I make my archive easier for people to use. Hope this helps!

Suggestions:

  • If you have a self-hosted WordPress blog and you write sequences of blog posts, give Organize Series a try.
  • Curious about what I’m learning? Suggest some sequences for me to organize or write about!

Thinking about the design of my blog

I hadn’t tinkered with my blog design in a while, since I’ve been paying attention to other things. Since I’m delegating podcast- and writing-related processes, I thought I’d revisit technical delegation too. Before I can delegate, though, I need to know what I want. I listed a bunch of blog improvements I’ve been meaning to do for a while.

2014-02-11 Thinking about blog improvements

2014-02-11 Thinking about blog improvements

I created a Trello board with the tasks. That way, I can keep track of the tasks as I assign them to people or do the tasks myself.  Trello lets me attach files (upload, Google Drive, or Dropbox), which will be handy for sharing designs.

One of the bigger tasks I was thinking about was making my site more responsive. 10% of my visits come from people using mobile devices, many from iPads and iPhones. On computers, it might be interesting to see how I can tweak my site design to make better use of larger screens.

2014-02-16 Thinking about web design #blogging #web-design

2014-02-16 Thinking about web design #blogging #web-design

For narrow widths, I was thinking of moving the sidebar down, trimming the navigation, and maybe making search more convenient.

2014-02-16 Thinking about web design and columns for my blog - #web-design

2014-02-16 Thinking about web design and columns for my blog – #web-design

I’ll need to sort out a good single-column layout for mobile devices, anyway. Do I want to keep the same distraction-free layout for larger screens, stay with my two-column layout, or add a third column? Hmm… Three columns might be too much. It might be interesting to test one- or two-columns. I’d like to be able to give people the ability to switch to the other style if they prefer. We’ll start with what we have, though.

2014-02-16 Thinking about post or page navigation for my blog #web-design #wordpress

2014-02-16 Thinking about post or page navigation for my blog #web-design #wordpress

I’m also interested in improving the navigation and discoverability of the posts in my archive. @madwilliamflint nudged me to logically arrange my posts, and the Organize Series plugin seems to be a good fit. Organize Series lets me define a series and the order of posts within it. It adds links to the series and the previous/next posts, and it also creates an archive page that lists the posts in order. Neat! See the trails I’ve defined so far.

I spent 4.5 hours last Monday moving my theme from a 960-grid to Zurb Foundation, which did make it surprisingly easy to make the site responsive. I fiddled with some of  the graphics, too. Check out sachachua.com to see what the site looks like now. =) I’m pretty happy with it, although of course there’s more to do.

It was great thinking about the things I want to tweak about my blog. Although I’m still thinking about finding someone I can delegate design or development tasks to, having a list of blog tweaks encourages me to tweak the blog myself (which is fun). I had fun setting up the series. I’m looking forward to trying out the other changes – either doing them myself or getting someone to do them.

Thoughts? What would make this site easier to use for you?

Reorganizing WordPress categories with Term Management Tools and other tweaks

Over ten years, my WordPress blog had ballooned to more than 500 categories. Part of it was because Org2Blog makes creating new categories super-easy, so I just piled them on (occasionally mispelling a few). Part of it was because I don’t really know what I’ll write a lot about until I write, so I had categories with one or two posts and then I moved on. Part of it was because I hadn’t decided what I’m going to use categories for and what I’m going to use tags for–yes, even after all those years.

I wanted to revamp my categories so that the Life, Geek, and Visual categories and their corresponding feeds might be useful to people who find my daily posts awesome-but-overwhelming and who would prefer a slice of my blog tailored to their interests. (There are even more categories on my archive page.) This meant organizing the categories into a hierarchy, but first I wanted to cut the number down to something more manageable.

The WordPress interface for managing categories leaves much to be desired when it comes to bulk actions. Fortunately, the Term Management Tools plugin makes it easy to merge categories or convert them to tags using additional Bulk Actions on the standard Categories screen.

I merged a few of the common typos, then converted any category with fewer than 10 posts into a tag. The original version failed silently when converting a category if a tag with the same name already existed, so I patched my version to silently merge the terms.

The Screen Options menu let me change the number displayed on screen to 100 items, which made it much easier for me to weed out most of my categories. Term Management Tools also provides a bulk action for setting a category parent, which was great for quickly reorganizing my categories into a hierachy.

I still had almost 3,000 uncategorized posts. Since I haven’t quite found or written an automatic N-gram text classifier for WordPress posts (if you have one, please share!), I decided to see if I could make a dent in this manually. I started by prioritizing the posts with comments. I assigned categories using the Posts screen, but that took a while and too many mouseclicks. The Categorized plugin automatically unchecks the default category once you select a different one, which saved me one click per post, but it still wasn’t enough. I ended up extracting a list of posts from my database with the following SQL command:

SELECT p.id, p.post_title, p.post_date, p.comment_count FROM wp_posts p 
INNER JOIN wp_term_relationships r ON (p.id=r.object_id AND r.term_taxonomy_id=1) 
WHERE p.post_type='post' AND p.post_status='publish' into outfile '/tmp/published.txt';

and another list of terms and taxonomy IDs:

SELECT t.*, tt.term_taxonomy_id FROM wp_terms t INNER JOIN wp_term_taxonomy tt ON (t.term_id=tt.term_id AND tt.taxonomy='category')
INTO OUTFILE '/tmp/terms.txt';

After a little spreadsheet manipulation involving VLOOKUP-ing the category name that I manually entered for each one, I copied the term taxonomy ID and post IDs into an Emacs buffer and used a keyboard macro to change it into the form:

UPDATE wp_term_relationships SET term_taxonomy_id=? WHERE object_id=? AND term_taxonomy_id=1;

where 1 was the term_taxonomy_id corresponding to Uncategorized.

Since I was on a roll, I decided to categorize everything from 2007 onwards, which is farther back than my manual index goes. That got me through about a thousand items before I decided it was enough filing for one day. As of the time of writing, there were 6512 posts on my blog. 4,536 posts (70%) belong to various categories, while 1,976 are still uncategorized.

I hope this work pays off! =) I expect that it will make my blog a little easier to browse.

Using Google’s In-Page Analytics to understand how people use a site

If you use Google Analytics to get some insight into how people use your webpages, be sure to check out Content > In-Page Analytics. It gives you an idea of what people click on, and that can influence your design decisions.

The posts on my blog homepage change roughly every week, so I used the drop-down in the top right to change the reporting date. Here’s what the overall stats look like for the main page of my blog:

image

Let’s look at the breakdown throughout the page:

2013-05-31 11_39_58-In-Page Analytics - Google Analytics

It looks like I should spend some time improving my About page, since a lot of people go to it.

2013-05-31 11_40_19-In-Page Analytics - Google AnalyticsSome blogs recommend removing the Recent Comments widget from the sidebar because people don’t find it useful. I find it handy for seeing what people are talking about, though, and it seems that other people do too. (21% of clicks to see older comments!) I switched to using the Better WordPress Recent Comments plugin in order to show comment previews. There’s a slight delay because I’m using the external Disqus commenting system which still needs to synchronize with WordPress, but I like it overall.

2013-05-31 11_40_37-In-Page Analytics - Google AnalyticsSome blogs recommend manually selecting Top Posts & Pages instead of leaving it up to the computer. This one is automatically selected based on recent views, which is great because it comes up with recommendations I wouldn’t have remembered or thought about (like that Drupal one!). I should make a Resources page, though.

2013-05-31 11_40_59-In-Page Analytics - Google Analytics

I include links to blog posts in my weekly reviews. This is surprisingly useful for both personal memory-jogging and for helping other people jump to things quickly.

2013-05-31 11_41_15-In-Page Analytics - Google Analytics

I have a hard time getting the hang of “Next page” and “Previous page” navigation on blogs. (Am I going forward or backward in time?) I changed my theme to make it easier to figure out which direction you’re going in, and I have these paging links at the beginning (near a table of contents) and at the end of the page.

2013-05-31 11_41_23-In-Page Analytics - Google Analytics

This is all the way near the bottom of the page.  It has the same numbers as the ones up top, so I think Google Analytics might be getting confused about the links because they go to the same place.  (Same with the Older Posts link.) I can probably disambiguate the links by changing the tracking code.

So, TODOs for me: spruce up my About page, figure out where to add a Resources page, look into asynchronous tracking, and see if there’s a way I can set up WordPress to experiment with different layouts…

Check out Google’s In-Page Analytics if you have it on your site!

Note: Got an error while trying to use In-Page Analytics? Make sure you’re properly calling the Google Analytics code on the site. I use a Wordpress plugin to make sure that my visits aren’t tracked when I’m logged in (no sense in throwing off the stats with obsessive refreshing! Winking smile ), so I needed to log out of my site before checking In-Page Analytics.