CogBlogged under ‘Wordpress’

These posts document experiments in hacking and tweaking Wordpress; I hardly call myself expert, but I do like to tinker under the hood. If there is something I can do for you, bark my way or visit me at http://cogdog.it

DIY is Fixing Your Blog

cc licensed ( BY NC ND ) flickr photo shared by PetitPlat – Stephanie Kilgast (in dolly mood) Anyone who does stuff knows you do stuff by doing it. Eh? Last night while I was visiting Alec Couros he asked me why there was no image in the right side of the header of my blog. Hmmm, maybe it is your browser, Alec? Nope, Chrome and Safari and Firefox were giving me a grey box too. Maybe it was the caching on my blog- deleted it. Nope. Now it is looking grim, maybe it is time to shop for another theme template. 30 minutes looking at other themes, and then contemplating all of the custom things I have hung on this one. Then I looked at the Developer console in chrome and noticed an error flag on something related to “href$=.mp3″ That looked like something related to the WP-Audio plugin [...]

Putting the Blog on the Hoist

cc licensed ( BY ND ) flickr photo shared by Lori Greig Ye old CogDogBlog seems to be teeter-tottering long; I am seeing a lot of 404s and Internal Server Error 500s, and the error logs are rife with unhelpful details like “premature end of script headers”. My last round of tweaks aimed at memory shortages has not helped, and it seems time for a round fo straw grabbing. What i think I know is that PHP is running out of memory before it can finish executing a big request, hence the death by early script headers. The next step of sleeve rolling up involves putting the blog on the hoist and banging the wrench on a few pipes underneath. I’ve already stripped my plugins down to a core set, and zapped a side bar external javascript widget. I have a choice: Try to identify a RAM sucking plugin. This [...]

When WordPress Has Memory Woes

cc licensed ( BY NC ND ) flickr photo shared by .m for matthijs I’m hoping to carve out some time soon to get back to the garage and return to tinkering with WordPress. To that end, I spent some time categorizing new and old posts, so I have a collection now of things blogged about using WordPress at http://cogdogblog.com/wp. Here at CogDogBlog, I’ve had some challenges with what I think is memory issues- lots of 404/not found on admin pages, and worse, strongs of deadly 500 Internal Server errors for visitors. Not good. No, not good. My web server error logs are full of the not very helpful “premature end of script headers” for index.php. You could spend years combing through the google results for this. What follows is not a definitive answer to this situation, just some guesses and results of my attempts to make it stop. To [...]

Stuffing ds106 into an Archive

Woah, it is ending? ds106 is almost over? Sigh. Well, sincr i have blog posts dribbled over the last few months, I thought about organizing it a bit better here in the doghouse- it’s not quite archiving, but it does feel like the suitcase needs help to get closed. cc licensed ( BY NC SD ) flickr photo shared by demandaj What I talk about below in likely un-reproducible code is what I did to generate http://cogdogblog.com/tag/ds106 Doing this has been part of some other WordPress tinkering around here. The current template here has 2 widgetized sidebars, and I shifted the rightmost one to be the “standard” one that appears on all pages. The left side one, by default, will have blog related things, but I also now use it on a few templates to create more relevant bits. To allow for a new widget, I edited my functions,php template [...]

Taking Old WordPress Menus to School

cc licensed ( BY NC ND ) flickr photo shared by ailatan With a relaxing day of nothing definite to do, I decided to poke around the corners of the blog house and clean up some dust gathered in the corners of my theme. Themes that predate WordPress 3, like mine, do not take advantage of the newer menu editing options. Old school themes were typically set up to turn Pages into menus, for example mine is wedged inside the header.php template: <ul class="menu"> <li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a title="<?php bloginfo('name'); ?>" href="<?php bloginfo('url'); ?>">Da Blog</a></li> <?php wp_list_pages('depth=1&title_li=&include=1358,887,2929,1620'); ?> </ul> where I have picked the pages listed by their id numbers to appear. This is rather tedious to edit and manage, and I also ran into issues because I [...]

NaNoWriMo-ing In the Open

cc licensed flickr photo shared by zenobia_joy Against every sane, rational, “I’m so over committed I’m gonna explode” thought, I have decided to plunge my hand again into National Novel Writing Month (NaNoWriMo), the challenge where aspiring, and maybe aspired, writers take on the goal of writing a 50,000 word novel over a one month time span. I have always liked writing, but had never done anything substantial or larger than a long blog post, so it was one of those items I listed long ago on 43 Things. I had heard of NaNoWriMo, and it seemed analogous to running a marathon — a goal you keep telling yourself you cannot do– until you try. Last year I made my 50,000 mark (I burned a lot of adjectives up in the process), finished, and got through about 1 1/2 rounds of later edits before hanging it out to dry (see [...]

Barking Dog Photo Blog

Note: Updated December 7, 2010 for use of new theme…. Nothing like a little WordPress hacking to get back in action. A few months ago I registered the domain barkingdog.me as a place intended to set up a photo gallery, but decided today to finally get around to hanging something for real there. My goals were to have a clean site with ginormous images, and also something that would be little fuss to add. On my NMC work in creating the MIDEA site I had set up an account to have access to the Graph Paper Press themes — yes, these are paid for themes, but are very elegant and sophisticated. I did moderate hacking to the Modularity theme for the MIDEA site, but was liking their photo gallery themes, and landed on Widescreen Fullscreen. With a few hours tweaking and adding one moderate hunk of code, I have what [...]

Rolling New Tweet Button into WordPress

UPDATE Jan 6 2012: While the code should still work, I have disabled this approach on my own blog, instead using the Sharing tool built into the JetPack plugin. Twitter has created a new widget that makes it more friendly to provide a tweet this button from your own web sites, blogs, etc. The benefit is that it pops a window up with the twitter functionality, so you are not sending people from the web site. See the announcement from the twitter blog to learn more. The tweetbutton creation widget makes it easy to generate the code, and has a umber of options to choose from for the appearance of the button and what gets prefilled in the tweet (plus with their new url shortener t.co is one letter shorter than competitors!). The sample code includes a Javascript link to the library that provides the functionality- <a href="http://twitter.com/share" class="twitter-share-button" data-count="none" [...]

Coding My Own WordPress Authors List

cc licensed flickr photo shared by bitzcelt Elwood: It’s 106 miles to get this sidebar coded, we’ve got a full tank of gas, half a pack of cigarettes, it’s dark and we’re wearing sunglasses. Jake: Hit it. I have no idea why I opened this way except for Jim Groom Inspiration. But to jive my code chops, there’s nothing more energizing than doing a little hack and chop coding in WordPress. Today I was again doing some sidebar fine tuning on the NMC MIDEA web site (previously covered in my almost done series on doing custom post types in WordPress 3.0). It was one of those “oh this might take 20 minute” deals that ended up going a bit longer. but like Jake and Elwood, when you gotta go to Chicago, you drop the sunglasses and hit it. And this is pretty simple, and most likely there is a plugin [...]

A Non Crappy WordPress Audio Player

There are tons of plugins available to embed audio/video in your blog. The things I don’t like with many of them are (a) they usually use “short codes”- things you hand write in brackets to indicate the location and source for the media (plus some options. Writing these means have to remember the structure, but more so, if you ever have to change to a different plugin down the road, you are left with short codes that might not mean anything. For years I had use Anarchy Media Player for the simplicity that all you had to was create a normal hyperlink to your media, and Anarchy would replace it with the suitable player. However, I had some major conflict issues with Anarchy last year, I noticed its javascript was hanging on loading, and in term hung my entire blog. I zapped it. For some reason I was thinking today [...]