
By Austin on April 15, 2009
This is a simple one.
/**
* Your Blog title
*
*/
function my_blog_title() {
$blogname = get_bloginfo('name');
return '<span class="blog-title">' . $blogname . '</span>';
}
add_shortcode('blog-title', 'my_blog_title');
Just add this to your functions.php file and then add [blog-title] in any post or page and it will return your Blog Title.
Posted in Tips & Tricks | Tagged functions, shortcodes, Tips & Tricks

By Austin on April 9, 2009
How might you display a Google ad after the first post or anything you like? It is very simple. You just need to add the variable $loopcounter in the Loop. If the $loopcounter is less than or equal to 1, then include your option. Check out the code:
<?php if (have_posts()) : while (have_posts()) : the_post(); $loopcounter++; ?>
// your loop
<?php if ($loopcounter <= 1) { include (STYLESHEETPATH . '/you-file.php'); } ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
Pretty simple huh. Well in the $loopcounter line, you may change the include to point to any file or maybe a custom widget like so:
<?php if ($loopcounter <= 1) { dynamic_sidebar( 'Plus Post' ); } ?>
Or use your code directly in between the { & }.
Posted in Tips & Tricks | Tagged php, the loop

By Austin on April 6, 2009
Here is a simple way to call query_posts with an array of options. For all options you my use visit: WordPress Codex.
<?php $my_query = array('showposts' => 4, 'post__not_in' => $do_not_duplicate); ?>
<?php query_posts($my_query); ?>
Posted in Tips & Tricks | Tagged php, query_post, WordPress

By Austin on April 2, 2009
Looking to add a favicon to you site?
Inside your WordPress theme’s functions file (functions.php) add the following to inside your PHP code.
/**
* FAVICON
* @WPCult.com
*/
function my_favicon() { ?>
<link rel="shortcut icon" href="<?php echo bloginfo("stylesheet_directory") ?>'/images/favicon.ico" />
<?php }
add_action('wp_head', 'my_favicon');
That’s it, just be sure to upload an icon image or a .gif/.png. Be sure to correct the target location id the file is located somewhere else.
Posted in Tips & Tricks | Tagged favicon, functions, functions.php

By Austin on April 1, 2009
Wow, have you heard? WordPress has announced that the newest version, 2.8 which was thought to be held off till September has actually been a secret project. They have announced that WP 2.8 has already been worked on and will be available today! ¶
Just in case..
Did you realize this was a April fools joke? Hopefully you weren’t to fooled, mine wasn’t as cruel as a few other out there in the web.
¶
Posted in Cult | Tagged 2.8, April Fools, WordPress
By Austin on March 31, 2009
I just came across this article over at WPLover. Was very good, especially since I just released my first WordPress theme. Seems like he’s got it down to a science, or at least a simple checklist. ¶
So you’ve completed your next great WordPress theme. You’ve tested them day and night, squashing bugs and CSS inconsistencies along the way. Your fingers are trembling, waiting for the time to release that theme to the wild. ¶
Posted in Cult | Tagged Themes, WPLover

By Austin on March 31, 2009
Posted in Cult | Tagged Hybrid Theme, Maintenance

By Austin on March 30, 2009
If you’ve downloaded the Swekey plugin and plan on using it for users to login here is what you might see.
The first image here shows what a user might see if and when you’ve got “allow registers” and said user has a Swekey plugged into there computer while registering to your site. I registered on a test blog I use, once I typed in my user name and email this pop up is what I saw. I checked ok, and another message stated that my swekey was now attached to my profile.
When I went to my profile I saw the Authentication section, where I could check or uncheck to use my Swekey that’s attached to my profile. Essentially with this enabled, I’ll I would have to do to login to the administration panel was have the usb with me, and at any public computer can pop it in and type in the address with out remembering my user name or password.
So.. I did a little test and this is what I saw. While logged into the admin panel, I pulled the usb key out and in a few seconds the page sent me to a “attempting to log out” page, and was unable to access the site until I put the swekey back in.
Posted in Plugins | Tagged Plugins, Swekey

By Austin on March 29, 2009
Anyone in the Los Angeles area? Well the first Sunday of the month is the LAWPUG, and since the weather is nice in LA, the meet is going to be held at the farmers marking on 3rd. For more info head over to LAWPUG.org.
Posted in LAWPUG, News | Tagged LAWPUG, Los Angeles, meetup

By Austin on March 28, 2009
I received a Swekey in the mail this week. What’s a Swekey you ask?
Like regular keys protect your car and your home against thieves and burglars, the swekey protects your internet accounts against any kind of piracy
Any swekey protected web site will never accept to log you in if your swekey is not plugged into your computer… Read more
So I am going to start off by stating that there is a WordPress plugin to enable this handy little USB key on WordPress powered sites. For information on the plugin you can visit it on the plugin directory.
Hopefully you’re using the latest WordPress install (2.7.1), in which you can head to the plugins menu and click on Add New. Do a search for Swekey and install the latest version (which at the time of writing this was version 1.0.7).
Once you’ve got the latest version installed head into your settings and find the Swekey setting page which will look like:

The Swekey setting on WordPress 2.7.1
I’m going to have to do some research on the first three options in the setting page, which I am not sure what other server URL I’d use or if needed be outside the localhost (which I am assuming is default — or left blank as it states).
The fourth option asks you whether you want to accept regular login’s without the swekey (in cause of misplacement) or to only allow login access with the swekey. For the most part I would not choose the latter option as the swekey isn’t that popular. This also might only be handy at the current state to the people inside the development of the Swekey, but a good idea none the less.
The next option inside the setting panel will either allow or disallow your users to attach/detach there profiles with the swekey to your site. If you’re site doesn’t allow users to register and you hand register everyone, you may want to do the same with this option.
Second to last, you can edit the Supported Brands: 8 chars hexadecimal upper case value. Which at this time am not sure what it does..yet.
The last option is simply a placement for the swekey logo if you choose to upload one.
So now we’ve got the plugin installed, I guess I better get to using and testing it before continuing anymore..
Posted in Plugins | Tagged passwords, Plugins, Swekey, USB

By Austin on March 27, 2009
At the time of writing this post I have Theme Hybrid as my parent theme, and am using a custom version of Hybrid News that Justin Tadlock offers to the public.
Well I want to tell you how you can add additional custom meta boxes to your child theme’s running the Hybrid Theme.
In your child function.php file just add the following to create a new post meta box:
/**
* Add additional post meta boxes
*
* by WPCult
*/
function wpcult_post_meta_boxes($meta_boxes) {
$meta_boxes['image'] = array(
'name' => 'image',
'default' => '',
'title' => __('Image:'),
'type' => 'text',
'show_description' => false,
'description' => __('Please use a full size image, larger than 500px (this photo will dynamically re-size itself!'),
);
return $meta_boxes;
}
add_filter('hybrid_post_meta_boxes', 'wpcult_post_meta_boxes');
This will create a custom meta box called Image, and will create a custom field with the id of image.
Additionally you can create this on pages as well by copy/paste and replacing “post_meta_box” with “page_meta_box” every where inside the function.
Posted in Themes, Tips & Tricks | Tagged Child Themes, functions, meta box, Theme Hybrid

By Austin on March 26, 2009
Have you ever uploaded an image that might have been a tad bigger than the width of your content area? I know I have! So here is a little CSS fix to handle these situations.

Resize those large images using CSS
.post img {
max-width: 600px;
height: auto;
}
That’s it, really simple huh. Just make sure that you change the .post to the correct body class(which starts with a “.“) or body ID(which starts with a “#“).
Would you like a quick explanation?
The CSS is just telling any image inside the class of .post to not be more than 600px wide. By the way make sure you change it to fit the dimension of your content width. And the height attribute is set to auto to automatically change the height to match the new width.
Posted in Tips & Tricks | Tagged CSS, image, width
Recent Comments