WordPress Designers and Developers in Minneapolis, MN

How to Show BuddyPress Admin Bar for Admins Only

Today I needed to figure out a way to show the BuddyPress admin bar only to users who are “Admin” level or higher. I lost a little bit of time, because I didn’t stop to think that the BuddyPress admin bar might require a different hook than the WordPress admin bar (whoops!). The code below can be copy-and-pasted into functions.php:

// show admin bar only for admins
if (!current_user_can('administrator')) {
	// WP admin bar
	add_filter('show_admin_bar', '__return_false');
	// BP admin bar
	remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );
}

Of course, you can edit the “current_user_can” function to display the admin bar for editors or contributors as well.

WordPress $category Content

I always have a hard time figuring out what my content options are when working with arrays in WordPress. Today I stumbled upon the content listing for Categories in the Codex:

$category->term_id
$category->name
$category->slug
$category->term_group
$category->term_taxonomy_id
$category->taxonomy
$category->description
$category->parent
$category->count
$category->cat_ID
$category->category_count
$category->category_description
$category->cat_name
$category->category_nicename
$category->category_parent

Pretty nifty, eh? Is there a better place to find content listings for tags, posts, taxonomies, etc.?

List WordPress Child Categories with a Pipe Divider and Links

Today I had a need to create a list of WordPress child category links in a theme. Each category in the list needed a pipe divider, except the last one. So my categories will look like:

Category 1 | Category 2 | Category 3

I looked into using wp_list_pages, but that didn’t quite get the job done. So, here is what I came up with:

<strong>Categories: </strong>
<?php 
$categories=  get_categories('child_of=12');
$total_number_of_categories = count ($categories);
$i = 1;
foreach ($categories as $category) {
	$category_name = $category->cat_name;
	$category_ID = $category->term_id;
	$category_link = get_category_link ($category_ID);
	echo '<a href="'. $category_link .'">' . $category_name . '</a>';
	if ( $i < $total_number_of_categories ) {
		echo ' | ';
	}
	$i++;
} ?>

Is there a better way to do this?

Edits Not Being Saved in Adobe Lightroom 3 on Export

I am writing this post to help save some soul(s) some time and frustration.

Usually I use Adobe Photoshop to edit photos for my WordPress sites.  Today I decided to give Adobe’s Lightroom software a try.

I opened Adobe Lightroom 3 for the first time and found that my photo edits were not being included on export.  For example, I would make a photo black-and-white, export it, and the exported image would remain unchanged.

The secret to solving this issue is to choose “JPEG” from the “File Settings” panel on the export screen.  I was choosing “original” (and why not?).

That’s all!

WordPress Classes in Minneapolis and St. Paul

I am working on a series of beginner WordPress classes for College of Visual Arts in St. Paul and CoCo in Minneapolis.  So far I have found creating a curriculum to be difficult.  The central question that I am wrestling with is, “Who is a WordPress beginner?”

There are beginners who fully understand the WordPress interface and are ready to move on to CSS and PHP, just as there are beginners who have probably never used a computer before.  There are beginners who want to blog, and there are beginners who want to set up an e-commerce website.  There are beginners who understand the web, and there are beginners who find logging into gmail to be a continual challenge.

A WordPress class can’t be everything to everyone, but hopefully it touches enough bases to make the majority of students feel like they got their money’s worth.  But this is the struggle.  Where is that sweet spot?

I have taught a number of WordPress classes via Minneapolis Community Education, and, by-and-large, those have been huge successes.  Most of the students who came through those classes left feeling like they were in a better position to go forth into the world of WordPress than when they began.

But those classes cost only $20.  We are looking at much higher price points outside of that environment.  And to paraphrase Spider Man, “With bigger prices comes bigger responsibility.”

I have considered all sorts of options including:

  • Beginner WordPress.com
  • Beginner WordPress (self-installation)
  • Getting Started with CSS in WordPress
  • Building Your First WordPress Theme
  • WordPress for Small Businesses
  • Beginner PHP in WordPress
  • WordPress for Bloggers
  • WordPress for E-Commerce
  • WordPress Multi-Site for Beginners
  • Building Your First WordPress Plugin
  • Fun with Functions.php
  • Photoshop for WordPress Users
  • Advanced PHP for WordPress

I don’t know that any of the above truly meet a majority of people’s needs, but I am guessing that the masses want a WordPress class that gives them the basics of how to create posts/pages/links, insert images/video, and do some other basic things.

So, I think I will start there.

What  WordPress class would you like to see taught in the Twin Cities?