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 […]

WordPress Comment Subscriptions by Category

flickr photo shared by duncan under a Creative Commons ( BY-NC ) license It’s particularly helpful in a rather specific situation- i.e. one where you’re doing a mother blog and want to see all the student comments (like Allen did with the #thoughtvectors reader) but since we have students using their blogs for more than one class things get messy fast. Enter me asking smarter people on Twitter, almost going to the forsaken land of Yahoo Pipes,1 and being saved by Google liking Mark more than me. So anyway, here’s the structure to get the comments for specific categories/tags. by name – http://bionicteaching.com/comments/feed/?category_name=apple by category ID – http://bionicteaching.com/comments/feed/?cat=18 by tag name – http://bionicteaching.com/comments/feed/?tag=tutorial-2 This is one of those things that barely rates a post but given I didn’t know how to do it maybe it’ll help some other wanderer and for people who want this it’ll be really useful. Thanks to Mark, Alan, and Martin for helping me out. 1 I like Yahoo Pipes but one has to assume Yahoo will kill it dead very soon . . . although I’ve been hearing that for several years.

30

It’s the little things . . . like hanging indents

Towards the end of the day I was asked for an easy way for students and others to do “properly-formatted (hanging indent) citations.” As I use URLs for citation I had never thought of this. A little googling and it seems to be a common issue for people and I eventually hit this old vintage1 video from Clint Lalonde (who I recognized immediately from his Twitter avatar). After seeing one jerk’s comment I felt a great need to make something even sort-of-good come from Clint’s effort to share something good with the world. Behold. The simplest possible WordPress shortcode plugin (SPWPSP – if you’re playing at home). And while it’s no SPLOT, it is very, very simple and it gives you the magical hanging indent. Just write [hangit]”None to Claim Their Bones: Relics of an Old Brooklyn Graveyard.” New York Times 8 Apr. 1888: 3-4. ProQuest Newspapers. Web. 10 June 2006.[/hangit] and you’ll get a nice hanging indent. I did have to change the shortcode to an enclosing shortcode (one that opens and close- like an HTML tag) to deal with quotes and apostrophes that are likely to show up in the citations. This is all it takes. Get it on Github here. 1 YouTube defines vintage as anything over a year old.

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 […]

Show Today’s Events

In WordPress it’s easy to delay publishing until a certain date or to show posts published on a certain date but I didn’t know of an easy way to show posts associated with a certain date. What I wanted to do was allow an instructor to write a bunch of posts about art related events in the local area. They’ll be browsable in a variety of ways but we wanted the ones that were relevant to today to show up on the home page automatically so they’d get attention etc. This was one of those scenarios where I say something like “I am confident it can be done but I’ve never done it or seen it done.” In my head it made sense. I tried a few different ways but I’ll start with the one that worked and was pretty easy. It does require that you make a child theme but I plan to make a plugin that’ll do it if you give me a few days. Anyway, here’s the chunk that does the work. It is, as usual, a result of looking through the WordPress Codex. This is the source for the current time and the light finally went on that I didn’t even need to search a particular custom field as I read this piece on wp_query for […]

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)

Bootleg Daily Create

Given a different type of planning I’d have started with Alan’s Daily Create Theme but that’s now how these particular stars aligned. Instead I had a course site that was mostly built and had been polished in a variety of theme specific ways when the daily create idea came up. I didn’t really want to mess with switching themes etc. as time is getting short. Plus there was probably more than a bit of curiosity if I could stitch 80% of the functionality together via non-programmistan means. I turned to a few of my old standbys to get this done. The theme remains Flat Bootstrap. The plugins pulling the majority of the weight are- Feed WordPress– pulls in the student blogs, Flickr images, and possibly Twitter via this Gravity Forms– lets the site admins create daily create prompts in a structured way without needing to know exactly what they’re doing Display posts shortcode– lets us easily embed the participant submissions with the prompt Simply Exclude– will allow us to include/exclude categories from specific pages. In this case I just wanted to keep the Flickr generated daily create elements from cluttering up the main bloggregate page. I’m ok with showing blog submissions here even if they are daily creates. On the looks side, I’m using Jetpack to do the custom CSS […]