Tag Archives: Content Management

Working with WordPress 3.2: Clutter free and high contrast help me focus; mono-spaced fonts too

WordPress 3.2 Editing a post

You know, I think I rather like working with the new WordPress 3.2 UI. I find it to be less cluttered, and the lack of color actually helps me focus on editing.

This version of WordPress is very WordPress 1-ish.

So far a few things that I have noticed about WordPress 3.2, that I like, is more space given to editing, the high-contrast and mono-spaced fonts (finally) in HTML view.

WordPress 3.2 uses Mono Spaced Fonts in HTML View

First Impressions, A Single Post in WordPress 3.2

I just posted a little bit about Mark Zuckerberg right after I updated WordPress to 3.2. At first, once I went to create a post, I was actually a little jarred, I have to admit. WordPress’s new font choice seems to be a little outdated to look at, I kind of wondered if something had gone wrong with my latest update (still wondering).

WordPress 3.2 using Arial as base font?

It looks as though WordPress has chosen to use Arial as their base font for most of the text. I’m not sure why, but for some reason this triggers 1990’s mode in my head when I see it. Arial is much easier to read, but it really feels out-dated. As for posting, I didn’t find it any different, still the same old kick ass WordPress!

WordPress 3.2 Buttons

There are some new graphics, a more steel kind of look given to the editing bar.

I’m not to fond for the rounded bevels and shadows on the left menu, and I found the previous versions “collapse menu” graphic to be much easier to use (compared to the new one).

The new look I’m not so mad-crazy for, but speed editing and clutter are among the top things I am going to keep a look-out for. That’s why I love that they finally made the site-title smaller!

WordPress 3.2 Smaller Site Title in Dashboard

Simple Google Adsense Code Insertion/Injection WordPress Plugin using Custom Fields/Meta

[iframe width=”100%” height=”349″ src=”http://www.youtube.com/embed/tKUq5TZFeCU”]

Today I was working on adding a Google AdSense Ad into a post on the site, and I couldn’t (easily) find a WordPress Plugin that would let me do that easily; so, as always, I wrote one.

[adsense metakey=”my-cool-adsense-ad”]

To use add the shortcode to your post. (Not here, because it would actually try and insert something, please see video on these steps.)

Put your adsense code (that you copy from Google Adsense) in a Custom Field and call it whatever you want (called adsense-ad-1 here). The shortcode will pull in the AdSense code from that Custom Field in the location you put the shortcode in your post.

Enjoy.

Simple Google AdSense Code Insertion Plugin [zip]

[php wraplines=”true”]
/*
Plugin Name: Simple Google Adsense Code Injector Shortcode
Plugin URI: https://devblog.aubreypwd.com/
Description: This easy shortcode will allow you to insert your adsense code easily into your posts. Just put your adsense code betweent <code>adsense /adsense</code>.
Version: 0.1
Author: Aubrey Island
Author Email: enethrie@gmail.com
Author URI: https://devblog.aubreypwd.com
*/

function adsense_hand_enji( $atts, $content = null ) {
global $post;
extract( shortcode_atts( array(
‘metakey’ => ”,
//’attr_2′ => ‘attribute 2 default’,
), $atts ) );

$code= get_post_meta($post->ID, $metakey, true);

return $code;

}

add_shortcode( ‘adsense’, ‘adsense_hand_enji’ );
[/php]

Change Sub Category to Main Category URL Structure (WordPress Remove Sub Category Hierarchy URL)

While working on Enjfi, I ran into an undesired feature. When browsing to a sub-category, in WordPress, I ended up with a URL structure like:

[sourcecode]

https://devblog.aubreypwd.com/category/sub-category

[/sourcecode]

Now, that usually works. But, with Enjifi, I may want to move sub-category under category-2, like:

[sourcecode]

http://enjifo.com/category-2/sub-category

[/sourcecode]

Now, all my links to /category/sub-category are not /category-2/sub-category, the undesired feature.

So, I found this, and I wrote a plugin for it (because it worked).

sub-cat-to-main-cat.zip

[php wraplines=”true”]
<?php

/*
Plugin Name: Change Sub Category to Main Category URL Structure (WordPress Remove Sub Category Hierarchy URL)
Plugin URI: https://devblog.aubreypwd.com/
Description: This plugin will tell your website to remap /category/category/subcategory to /category/subcategory
Version: 0.1
Author: Aubrey Island
Author Email: enethrie@gmail.com
Author URI: https://devblog.aubreypwd.com
*/

/* From: http://wordpress.stackexchange.com/questions/7807/changing-the-category-permalink-structure/7817#7817 */

add_filter( ‘category_link’, ‘wpse7807_category_link’, 10, 2 );
function wpse7807_category_link( $catlink, $category_id )
{
global $wp_rewrite;
$catlink = $wp_rewrite->get_category_permastruct();

if ( empty( $catlink ) ) {
$catlink = home_url(‘?cat=’ . $category_id);
} else {
$category = &get_category( $category_id );
$category_nicename = $category->slug;

$catlink = str_replace( ‘%category%’, $category_nicename, $catlink );
$catlink = home_url( user_trailingslashit( $catlink, ‘category’ ) );
}
return $catlink;
}

?>

[/php]

Allow HTML in your Category Descriptions in WordPress

So, while I was actually starting to move posts over to this lovely site, I noticed that when I saved a category’s description, certain HTML was being stripped.

For example (please no comments on quotes, this is HTML5!),

[html wraplines=”true”]
<a href=http://www.vim.org/ target=_blank>Vim</a> is an editor that I came across when looking for alternatives to, what I was currently using, <a href=http://notepad-plus-plus.org></a>Notepad++. I eventually started customizing it and trying to get it to work for me. At one point I even gave up, but came back to give it a try again.

It eventually lead to <a href=https://devblog.aubreypwd.com/category/vim/aubreys-gvim></a>Aubrey’s gVim, as well as <a href=/tag/vimtips>vimTips</a> and <a href=/tag/aubreygvimtips>Aubrey’s gVim Tips</a>.
[/html]

In this piece of code, inside a category description, though links were allowed, the class=it was not!

This plugin really came in handy!

[Allow HTML in Category Descriptions]