St. Louis WordPress Designer

Hi,

I’m more of a programmer that bends and shapes WordPress to work for my clients, but you can call me a designer if you want to.

I do also design custom websites using WordPress as a CMS  … I’m located in Saint Louis Missouri and would love to design a custom WordPress website for your needs.

I’m always available for freelance or corporate sized projects projects; so just clicky over to http://www.314media.com/request-support/ and let me know what you are looking to do…  I’ll probably get back to you in just a few minutes.

Let’s bend and shape WordPress into something that is a perfect solution for your WordPress website needs.  I can design some pretty rock star layout too; or I have one of my awesome graphic designers do it for you.

Thanks for looking at my blog page…

WordPress – Create Dynamic Sidebars for Categories

So I spent a few days in the rabbit hole looking for a way to generate custom sidebars for categories and single pages – and display those sidebars dynamically based on what page/category template was being called..  Thankfully; there are a few hooks that allow for finding the category, displaying the category name, and using variables in the dynamic_sidebar function … Registering them ain’t too tough either…

Cutting to the chase; this is the function to register the sidebars based on what categories (that have posts; and are not empty) are in the DB … Dump this in your functions file and look at the widgets section — you will see new sidebars based on categories that you have that have posts – and these sidebars will be named the category name … Feel free to edit the before and after variables to match your existing theme:

if(function_exists('register_sidebar')) {
  foreach((array)(get_categories()) as $category) {
  register_sidebar(array(
    'name' => $category->cat_name,
    'before_widget' => '<div id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3>', ));
} 

Then; your going to need to find out what category the post is in within the WordPress database and display the appropriate sidebar for that category.  You can use whatever widgets you want in there — this code has been tested on the index; category.php and single.php .. Using this on the archive or any other page — your mileage may vary…

<?php
$category = get_the_category();
$string = $category[0]->cat_name;
dynamic_sidebar( $string );
?>

That’s about it — If you need custom sidebars for categories in WordPress; this post should do wonders for you … Just a little code seems to go a long way with WordPress :)

Also; I have no idea what happens when a post is in two categories — you could do a for each in the dynamic_sidebar code; but my little project had things only categorized once .. Cheers!

WordPress Image CSS

After I create a custom theme; I always forget about the CSS to control the image alignment controls .. Lol; so here it is:

img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}

WordPress Ping List

http://api.moreover.com/RPC2
http://bblog.com/ping.php
http://blogsearch.google.com/ping/RPC2
http://ping.weblogalot.com/rpc.php
http://ping.feedburner.com
http://ping.syndic8.com/xmlrpc.php
http://ping.bloggers.jp/rpc/
http://rpc.pingomatic.com/
http://rpc.weblogs.com/RPC2
http://rpc.technorati.com/rpc/ping
http://topicexchange.com/RPC2
http://www.blogpeople.net/servlet/weblogUpdates
http://xping.pubsub.com/ping
…just drop this in the writing section and you’re good to go.  Thanks Vladimir!!

List posts from the same category on single sidebar

Seems people actually read this blog; so thought I’d pass this along – How to list posts that are in the same category when you are on a single.php page…

<?php if ( is_category() ) {
global $wp_query;
$current_cat_id = $wp_query->get_queried_object_id(); ?>
<div id="category-posts-<?php echo $current_cat_id; ?>" class="widget widget_recent_entries">
<div class="widget-title"><h3><?php single_cat_title('Recently in '); ?>:</h3></div>
<div class="widget-content">
<ul>
<?php global $post; $cat_posts = get_posts('numberposts=10&category='.$current_cat_id);
foreach($cat_posts as $post) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php } ?>

This blog’s turning out to be a quick reference wiki for code – wow…