Knowledge Base
Did you know I was in the New York Times?
katemgilbert : February 6, 2012 5:29 pm : Features, Tutorials and How-To's, WordPress
Yup, I was. I spoke to a reporter about the process (and headache) of setting rates and enforcing small business practices as a soloprenuer. It was my 15 minutes of fame. Check it out. And for all the developers out there who find my BP and WP tips helpful, maybe this will help you on your bottom line, too. Don’t undervalue your work!
Putting a Price on Your Work, New York Times Business Section, Jan. 29, 2012
As a bonus, my office is now totally spartan clean, which will save me time when my parents come to visit later this month.
Cross-browser compatibility is a major issue in CSS design. That there is a browser (IE) that frequently requires special rules, AND is not available on Mac platforms is enough to make any web designer want to pull their hair out. For so long I’d run a Windows laptop on my desk next to my Mac, but that became cumbersome. And while I don’t want to weight down my OS with a full Parallels install, I need some way to see how my sites look in IE.
WineBottler offers the solution. Install it on a Mac and you can fun IE6, IE7, and IE8, along with other Windows apps, in your Mac environment. Perfect for cross-browser CSS development!
Make a BuddyPress core page members-only
katemgilbert : March 15, 2011 6:54 am : Tutorials and How-To's
BuddyPress is a great resource for a private members-only network, but be careful of the access restrictions you employ. Plugins like Member Access, which offer protection to pages and posts, won’t protect your BuddyPress core template pages like Members, Groups, Forums, etc. To keep these pages private, you have to get a little creative.
Here’s how to do it:
Find the loop of the page you want to protect. Today I am working on the Member Directory of a site, or the /members page, so I opened /members/members-loop.php from my BuddyPress theme files.
At the very top of the page, I inserted this conditional statement to check if the viewing user is logged in, and to show them an error message if not:
<?php if ( !is_user_logged_in() ) : ?>You must be logged in to view this section.<?php endif;?><?php if ( is_user_logged_in() ) : ?>
This second conditional statement wraps the member loop itself, so don’t forget to close it off at the bottom of the file with a new:
<?php endif;?>
Viola! Subsequent visits to the page show the error message if I’m not authenticated into the system, protecting the member’s profile data from outside visitors and search engines.
I took it a step further and styled the error message to match my site and its tone, including a hyperlink to the log in information page for member access info and password resets. To do this, I turned the first chunk of our conditional statement into this:
<?php if ( !is_user_logged_in() ) : ?><p><strong>The Member Directory is for members only.<br><a href="#">Click here to log in now</a></strong></p><?php endif;?>
Modifying the header in BuddyPress profiles
admin : November 11, 2010 8:19 am : Tutorials and How-To's, WordPress
I am using BuddyPress to manage member profiles and member interaction on a large WordPress Multisite install for one of my clients. Every time you see a member’s name – whether in a blog post, activity stream, member directory, etc. – you can click to view their profile. Perfect for this corporate client’s network. But on first install, the BuddyPress default theme does something wonky: When it displays the member’s name in the header of the profile, it echoes the username with an ‘@’ sign, and appends a ‘?’ Why? I have no idea. So I set out to find the location of this code and fix it, which wasn’t an easy task.
To alter the code of the header in a BuddyPress member profile, find your member-header.php file. This will be specific to the BuddyPress theme – different than the WordPress theme – deeply buried in the plugins folder under the following path:
/wp-content/themes/suffusion/members/single/member-header.php
Open that file and find the offending line:
<span class="highlight">@<?php bp_displayed_user_username() ?> <span>?</span></span>
It appears at the very top, right after the file calls out the member’s display name, like so:
<h2><a href="<?php bp_user_link() ?>"><?php bp_displayed_user_fullname() ?></a></h2>
For my purposes, I’m going to comment out the displayed username, complete with ‘@’ and ‘?’, and leave just the displayed full name. Viola! The wonky username echo is gone!
This file location would also come in handy if you want to customize the header of the member profiles with imagery, branding, or custom fonts. The sky is the limit! Let me know if you need help putting it into practice.
Modifying category.php to add a category-specific RSS button
admin : November 3, 2010 9:22 am : Features, Tutorials and How-To's, WordPress
I’m working on a site that relies heavily on categorized posts for dynamic content. Using plugins like Embed RSS, we’re able to call the latest posts from any category into another post or page quite easily. But what about users who may want to subscribe to a category-specific RSS feed? They should be given the option when viewing all posts from that category on the site via the category.php template. Here’s how.
First, we tell the category.php template to print the name of the category being displayed:
<h1>Category Archive: <?php echo single_cat_title() ?>
Then we use that echo call in the hyperlink, like so:
<a href="/category/<?php echo single_cat_title() ?>/feed">
So now, when the user clicks on the RSS button, they are linked to
http://mysite.com/category/categoryname/feed
The category-specific feed we were looking for, dynamically changing depending on which category is being displayed.
Need help modifying WordPress template files? Drop me a line, maybe I can help.
