Thesis Custom Box + Sidebars to Genesis Split Sidebars

Visually split the primary sidebar in Genesis into two further sidebars, each with their own widget area.

View the code

HTTP Error FixCan now upload large images

When uploading large images over an approximate size (~2500×2000) I was encountering the HTTP Error message when trying to crunch the image (which ultimately fails and doesn’t produce the smaller pre-defined image sizes).

After trying several solutions, the following appears to have solved it for my setup, once and for all – add this to your .htaccess file:

View the code

Style Sheet Header ImprovementsTidy up your WordPress Theme Details

The Theme Review Guidelines are often updated as each new version of WordPress is released, and although these guidelines are for themes submitted to the WordPress theme repository, they are a good baseline to which all themes should strive to achieve.

If your theme was written a while ago, your site might not be following all of the current best practices. Here are a few simple alterations you can make to your style.css file.

View the suggested improvements

How to Remove Title Attributes on Genesis Menus

Genesis 1.6 has removed the menus that this tutorial applies to, in favour of using native WordPress custom menus, but they can be added back in via Nick‘s Genesis Nav Menu Amplified plugin.

If you’re using the Genesis-created menus from the Theme Settings page, you don’t have as much control or flexibility as using custom menus. You may not want to switch to custom menus, just to remove the title attributes, say, so we need a different solution.

What Are Title Attributes?

Demonstration of a title tooltip

Demonstration of a title tooltip

The title attribute is most often seen appearing as tooltips when you hover over one of the menu items. With custom menus, you can edit the title attribute to what you want, or even remove it altogether, but with the Genesis-created menus, it’s automatically populated, and there’s no interface for removing them.

However, we can remove them with some code.

Open up the functions.php file in your child theme and add the following code. The code should be entered at the end of the file, just before the closing ?> if there is one.

add_filter( 'genesis_nav_items', 'child_remove_navigation_titles' );
/**
 * Remove all title attributes on Genesis-created navigation menus.
 *
 * @author Gary Jones
 * @link http://code.garyjones.co.uk/remove-genesis-navigation-titles
 *
 * @param string $menu HTML markup of menu list items
 * @return string HTML markup
 */
function child_remove_navigation_titles( $menu ) {
	return preg_replace( '/ title="[^"]*"/', '', $menu );
}

That looks through all of the navigation list items (Pages or Categories) for title="…" and removes them, before returning the list items markup to the function that creates Genesis menus.

Being Selective

What would you do if you just want to remove the title attributes on either the primary or secondary navigation, rather than both? Some slight changes are needed:

add_filter( 'genesis_nav_items', 'child_remove_primary_navigation_titles', 10, 2 );
/**
 * Remove all title attributes on Genesis-created navigation menus in the primary location.
 *
 * @author Gary Jones
 * @link http://code.garyjones.co.uk/remove-genesis-navigation-titles#being-selective
 *
 * @param string $menu HTML markup of menu list items
 * @return string HTML markup
 */
function child_remove_primary_navigation_titles( $menu, $args ) {
	$args = (array)$args;

	if ( 'primary' == $args['theme_location']  )
		$menu = preg_replace( '/ title="[^"]*"/', '', $menu );
	return $menu;
}

That would remove all the attributes for Pages or Categories menu in the Primary Menu slot. You can make it specific to just the Secondary Menu slot by amending all occurrences of primary to be secondary, particularly on the highlighted line.

To remove from WordPress custom menus too, you can hook the same function into the WordPress filter:

add_filter( 'wp_nav_menu_items', 'child_remove_primary_navigation_titles', 10, 2);

Install WordPress via SSH

  1. SSH into your server, then navigate to your domain’s web root:
    cd /var/www/vhosts/example.com/httpdocs
  2. Grab the latest WP install
    wget http://wordpress.org/latest.tar.gz
  3. Get the files out of the archive:
    tar xfz latest.tar.gz
  4. Navigate to the wordpress subfolder:
    cd wordpress
  5. Copy everything back up to the web root:
    cp -rpf * ../
  6. Navigate back up to web root:
    cd ..
  7. Remove the wordpress subfolder:
    rm -rf wordpress
  8. Remove the downloaded archive file:
    rm -f latest.tar.gz