Blog

Category: WordPress

  • Final Projects: Website Construction I [TH481A], Summer 2011

    Had a really great two weeks with my summer session students this year. After 15 hours of instruction on everything from digital content for musicians to file and folder organization to HTML basics to a PHP/MySQL powered events calendar, here’s what they came up with:

    All in all, I think they came out pretty damn well! When I think about the wide-eyed look these conservatory-trained musicians all gave me when I started going on about tags and servers on the first day of class to the new efficiency with which they are all editing in Textwrangler/Notepad++, saving, uploading with Filezilla, and viewing in the browser, I’m selfishly proud of myself and also very proud of these students, all of whom are my age or a little older (no extremes this year).

    To the students: Congrats, everyone! I know you’ll all keep tweaking away at your websites and discovering more and better things to do with them. The course website will continue to function and your accounts will remain. I may miss things on the forums after this month unless I set up email notifications on new topics somehow, so stick to email if you have an urgent question. I wish every one of you could stay for the next two week session as well. For those who are continuing on, let’s just say that you will be subjected to my zealous love of WordPress and really be thrown into the deep end. Get ready 🙂

  • More WordPress thoughts

    I know it’s common to put a lot of time, energy, and work into other people’s projects and let your own personal ones suffer. I feel like that’s what’s happened to my own blog.

    First of all, I need to write more, period. Second of all, I need to modernize this theme and add some functionality! I spend so much time these days making custom CMS themes and functions and super-awesome screenshot-filled documentation and installing and configuring a ridiculous number of plugins for clients and my regular job, but I don’t seem to bother with my own.

    I’m still using this ancient theme (which I don’t change because I still like it) and it’s got some old old stuff going on. The comments are especially ugly and don’t have threading enabled. I’m sure it’d be easy enough for me to fix my own stuff, but I guess it’ll have to wait until I don’t feel guilty for not focusing on open projects, including a piano recital next Wednesday. Perhaps I’ll use that Lady René font (yes, the purchase happened) to make a new header so I feel like I’ve done something. But for now, off to do a little late-night practicing that won’t bother my neighbors!

  • WordPress 3 Function: Sites in Dashboard menu

    Edit on May 26, 2011: With the release of WP 3.1, the admin bar has links to each of your sites. Way easier, but that doesn’t keep this from working. I just won’t make this into a plugin. Also, subdomains need a different treatment!

    In the process of creating a WordPress theme for work (trying to move to WP as CMS! YAY!), I realized that the procedure for accessing the Dashboard for a site besides the one you are on can be a little obtuse and involves too much clicking. Since a huge part of the focus and reasoning behind this project is ease of use for content editors (death to Contribute), I thought it would be smart to have direct links to each applicable Dashboard within the Dashboard admin menu. In conjunction with Ozh’s wonderful Admin Drop Down Menu, I have to say that it looks pretty freaking awesome. I put this function in the theme’s functions.php file so that it applies to all network sites, but I wonder if it would be a smart thing to write and release as a plugin. So, here for you to use or rip apart – only mild testing has been done, so don’t be too mean:

    /* add dashboard links to each user site underneath the Dashboard admin menu */
    
    function hhs_sites_menu() {
    	global $current_user;
    	$sites = get_blogs_of_user( $current_user->id );
    
    	// make sure multisite is on, the current user has permissions, and has more than one site
    	if ( is_multisite() && current_user_can('read') && count($sites) > 1 ) {
    		foreach ( $sites as $site ) {
    			// make the URL a relative path; escape twice in case the user is in a network site (subdirectory)
    			$relative_admin_url = preg_replace('/http:\/\/www\.yourdomain\.com/', '../..', get_admin_url($site->userblog_id) );
    
    			add_dashboard_page( $site->blogname, $site->blogname, 'read', esc_url($relative_admin_url) );
    		}
    	}
    }
    
    add_action('admin_menu', 'hhs_sites_menu');

    I’d like to deal with the URL to each Dashboard in a better way. Escaping up two directories is hacky and ugly and wouldn’t work for somebody on a subdomain multisite installation of WP3. It has to do with the way WP wants an internal page within your current wp-admin – the better way would probably be to use a make the callback function redirect to the appropriate Dashboard. This would also allow me to use CSS to define icons for the drop-down version of the admin menu. I could use CSS now, but the ID that is generated is super ugly (i.e. oamsub_http:_______wp-admin – YUCK). Maybe during work hours tomorrow I’ll chew on it a little more.

    If I were to make this into a plugin, I’d want/need to:

    • Make it compatible with both subdomain and subdirectory multisite setups
    • Only allow network activation (makes no sense to only have it activated in one, at least to me)
    • Make it easy for a network admin to assign a custom icon to each site for use wherever applicable (i.e. the admin menu drop-down)

    Thoughts? Hesitations?