21

Auto-Built (and Linking) Table of Contents in Google Docs

I did a workshop on productivity and now know that I took a bunch of knowledge for granted that could be helping people. So my new goal is to do a better job documenting stuff just in case it’s of use to people. To be clear, I don’t really care what people do with the time they reclaim from trivial and/or unpleasant tasks. I just hope to alleviate some degree of suffering. Maybe they’ll use their extra time to go for a walk or pet a puppy or something. You might also note the sub 60 seconds video tutorial time.1 1 I just want to tell you something as quickly as possible. Video tutorials seem to tend towards lengthy meditation sessions although now that I can control the playback speed very exactly they may become tolerable.

Gravity Forms + FacetWP = Gravatar People

Having just finished presenting1 at NMC. I said we all need to document more, to show examples and explain what we did. Making the notes for the presentation last night and being able to use the blog posts I’d already written really showed me the value of reflecting on little things in an ongoing way. It’s amazing how much stuff I do that I completely forget even happened. So this is how you’d make a gravatar people browser based on information submitted via a Gravity Form.2 This image above shows the basic setup for the Gravity Form. Form fields essentially get combined with some HTML in the post body field. It’s pretty simple but it might help someone. This is the basic setup in FacetWP that generates the query and the display code. There are two elements. Element one is the query which tells which pieces of content you want. The second part is the display which shows the content that you’ve retrieved in whatever way you define. The text version for the FacetWP template is below. There’s also a dab of CSS. 1 Or at least talking in a room with humans in it. It was not of enough quality to justify the term presentation. I need to figure out why that felt so bad. 2 Could also do […]

Faster Faster NMC Notes

I’m doing Faster Nyan Cat!1 Build! Build! tomorrow at NMC so . . . I’d better get moving on linking all this madness into some sort of coherent story with examples. So take a deep breath and . . . go look at another webpage. This is going to be long. Consider it something between speaker notes, reference links, and that scene in A Beautiful Mind2 links everything together with string.3 Once Upon a Time There was a guy who didn’t know how to program but who had quite a few needs and even more odd dreams that he wanted to come true. He was from Alabama which made it perfectly acceptable to make things work with a combination of duct/duck tape and bailing wire (even high tech things). This is the story of how to do stuff like that. It isn’t best practice.4 It may not even be good practice.5 It is simply a way (that has worked) to get lots of work done quickly within the narrow confines of my skill set. Keep in mind, I did a presentation for NMC previously with Jim Groom entitled Nonprogramistan and with the URL /ihatecode.6 There’s also some SPLOT-ish connotations to some of this stuff- just making a one purpose tool that allows users to do one thing with no usernames/passwords […]

Improved Google Folder Shortcode Plugin

creative commons licensed ( BY ) flickr photo shared by Steve Snodgrass In December I wrote a tiny shortcode plugin that would let you embed Google Folders in WordPress. It was mainly to get around the iframe embed issues in WordPress Multisite. This interaction seems to make a number of faculty members pretty happy. So tonight when I got a comment asking how you’d get the plugin to display a grid view instead of the list view I decided to take another look at things. The short answer is that you could not do that with the old plugin. Now that I’m pretending to write code and stuff I thought I might be able to fix that and it turned out to be fairly simple. While I was in there I also added the ability to manually set height and width parameters. The new plugin is here. It doesn’t like it when I run both on the same blog (I assume because of the shared shortcode name) so this demo required that I turn off the older plugin. To make the changes I followed the Codex advice on handling attributes. This stuff still feels like magic to me. I realize how little actual skill and knowledge I posses in the scheme of things but it is amazing fun to be […]

More Dates in WordPress

creative commons licensed ( BY ) flickr photo shared by peacay As I continue to mess around with time/calendaring in WordPress I thought it’d be helpful to be able to allow users to add specific events1 to the calendar service of their choice. That led me to the addthisevent.com javascript. It allows the user to choose the calendar format of their choice from a variety of options plus it’s free for non-profits and schools. Initially, I just threw a script link in the footer of my Time child theme but that’s not really how you’re supposed to do things in WordPress Land and it meant that a pretty useful action would be restricted to that single theme. There are also some people in the AddThisEvent comments requesting WordPress plugins. Since I’m wandering around the borders of Programistan anyway, I figured I’d write a plugin. This may be beating a dead horse in terms of detail but I’m hoping it might help other people who aren’t programmers get things done. Version 1 The first version was as barebones as you can get. It does via plugin what I did previously via the theme – stick the addthisevent script in the footer. I referenced the WP wp_enqueue_script2 page in the codex to do this. You can see it commented up below. Version […]

Dating WordPress

This post is going to attempt to document how I figured out how to mess with dates in WordPress custom fields. I don’t know how widely valuable that is but a number of the concepts are probably broadly applicable. This particular discussion will wander into areas of programistan and there is one child theme page involved.1 It’s live and working (although it may occasionally be down when I do something odd and it’s ugly as sin at the moment) but feel free to look around or add some fake events. Getting all posts with a custom field named ‘event’ to show on the front page was discussed here. I added a bit to the theme so that if there was more than one event on that day it’d display it with a different format. You can see the whole page on GitHub here. The other little chunk of code that might matter is what’s returned if there are no events on that day. It just tells you nothing is there and presents you with the events for the next seven days as defined by the FacetWP layout (which I’ll go over in a bit). Now that we had a decent way to see what was going on that day, I built the “Event Creator” form which will allow the instructor […]

13

bbPress and Multisite Sanity Saver/Savior

By default bbPress will enroll you as a form participant on every site you go to when you’re logged in on a multisite installation. It is meant to be helpful but usually results in a headache. People get nervous that people they don’t know are in their users list. Other people want to un-enroll to clean up their sites list. I found this solution a while back but since the way I did required modifying a core file it was overwritten on a recent update. It took me a while to figure out what what was done where so I’m putting it in this post as a reminder and with slightly more specific directions for other similarly clueless people. You’ll be editing the following file bbpress/inlcudes/users/capabilities.php that ought to live in your plugins directory (wp-content/plugins/bbpress) All you need to do is look for the /** Ready comment and then replace the code below with (I duplicated some code that isn’t actually replaced to help show more context)

Let the Birds Sing (Feed WordPress Filter)

Sometimes it’s the tiny, little bitty things. This is one of those times.1 Issue: Lesley Bullock is an awesome ornithology instructor who has all her students doing field work and they’re aggregating their work to a main mother blog hub. She is even having them record and upload bird songs which is entirely awesome. The problem was that when aggregated, the built in WordPress player wouldn’t show up. Oddly, it’s there in the code. I could see it there taunting me (below). However, the visibility was set to hidden. Once I realized the content was coming in, I tried the least invasive response- that is I just tried to override the CSS using the custom CSS option in Jetpack. No dice. Given that this is hardcoded into the post at the element level that wasn’t a huge surprise but it was worth a shot.2 I considered a few other options- Feed WordPress advanced filters, altering the core WordPress files . . . and they either wouldn’t do what I wanted or they felt too dramatic given the limited use case. I eventually got to the wonderful site for Feed WordPress (far superior to the WP plugin support page). There’s all sorts of good information on creating plugins/filters for Feed WordPress. What I ended up making is incredibly trivial but it […]

Semi-Programistan and Other Conundrums

I can create basic child themes. I can make some low level plugins. I can take themes and plugins as they’re given and live with the shortfalls. Lately I’ve become (more?) interested with the space between those two options. Can I use one or two plugins to create the equivalent of on-the-fly-child-themes? Can I teach other people who aren’t interested in making child themes how to do it? How replicable are the design/building patterns? To parallel that line walking, I’ve repeatedly tried to deal with the example/tool/tutorial structure in a way that might get people curious. Building lists of tools doesn’t appear to have advantages long term. I’ve done that too many times. Plus it puts the focus on the wrong element from the start. At the same time people need to see the association between tool and possibility.1 For this to ever really work well there has to be a fairly tight entwining of tool, possibility, and example. This site is supposed to show examples by discipline, tell how to make them (tutorial/FAQ), and add in other interesting and useful elements. It may be this matters more to us internally. It’ll help provide a quick way to find examples in the moment of need when talking to instructors and provides enough documentation for most of our internal people to […]

Bootstrapping Nonprogramistan

I want to be like Alan Levine someday but as I slowly progressively acquire the necessary coding skills I often make do with various kinds of semi-programistan hackery. Today was an example of that and so worth a bit of blogging. Jesse Goldstein, one of a cadre of most favored sociologists, sent me an email asking how hard it’d be to do a few things with his course site for Understanding Capitalism. He wanted the front page to have – three columns- each from a separate category a way to highlight items of import in the leftmost column a static chunk of text in the leftmost column There are lots of ways to do this. I’m actually confident I could write a child theme to do this . . . but it was fun to do it without that and to do it in about 30 minutes as we sat at the .1 The Theme Jesse course started out with the tried and true Twenty Fourteen theme. It’s a nice theme but not really the one I’d choose for something with three columns. I’ve really been enjoying Flat Bootstrap lately. It’s nice and clean both in the code and in the presentation and it’s, as the name implies, built on the Bootstrap framework which makes all sorts of neat tricks […]