Edmonton Web Design and Photography

New in WordPress 2.9: Post Thumbnails!


With the latest update to WordPress 2.9 you now have access to a few new functions to handle thumbnails for blog posts.

I will keep this quick as it is a simple process.

You will need to let wordpress know that your theme supports thumbnails. For this we need to open functions.php and declare thumbnail support. For this we add the following line of code.

add_theme_support( 'post-thumbnails' );

We will need to set the thumbnail dimensions now.

set_post_thumbnail_size( 80, 80);

It should be noted that this method of resizing will produce an image no larger than 80×80 and will not distort the image.

If you choose to crop for square thumbnails then you would enable Hard-Cropping. This way your image is exactly the size you want. This method will crop the image center out.

To enable Hard-Cropping you would use the following line of code.

set_post_thumbnail_size( 80, 80, TRUE);

My functions.php now looks like this.

if ( function_exists( 'add_theme_support' ) ) {
	    add_theme_support( 'post-thumbnails' );
	    set_post_thumbnail_size( 80, 80, true );
	}

Read on..

Posted in: Web, Wordpress on January 2nd, 2010
by: Adam Patterson

Beef with WordPress Stat Pluins.


I’m always interested in know were were my visitors are coming from and how they got here. I have tried many Stat options. WordPress.com Stats, Fire Stats, and Live Stats. What you might not think of is the load on your Database. One visit might be minute but depending how how the Stats are set up to record the meta data you could be storing a couple kilobytes per visit.

Whats a couple KB you say? well if you take your IP address, the date, the page you landed on, the page you came from, and ID# and more than likely some other information will be captured. All this for every visit. Now think about how many page views you get and for how long you used the script.

In my case i used them for a few months, never really looking at them all that much because i perfected Google Analytic’s. I was shocked to see a 22mb Table for Live Stats.

I would suggest using Sticking to some form of off site Statistic Application such as Google Analytic or WordPress.com stats now i cant say for sure that the large Database size created by these stats plugins will cause WordPress to act sluggish. but since i have basically started from scratch i can say that it is running much faster.

In short, Don’t use WordPress Stat plugins unless they are off site. Another good point to make is to all the WordPress plugin developers out there, Make a uninstall for you plugins, many don’t clean up after them selves once you have deactivated them.

Posted in: Wordpress on December 2nd, 2008
by: Adam Patterson

And I’m A Mac


A few days ago i found andimapc.com and made my own version. It follows the format saying then catch phrase. Another example is When Obama Wins. I spent a little over 2 hours creating the site, another 30 min changing the design to be less like andimapc.com, and then a few hours creating a moderation system for it due to abusers.

Go have a look.

Posted in: General, Programming, Wordpress on September 30th, 2008
by: Adam Patterson
Comments Off

Admin Comment Highlighting for WordPress


I tried a few examples from the internet and neither seamed to work properly so i adapted the two that i found.

First things first:
Open your comments.php file and look for a line like this.

<li class="<?php echo $oddcomment; ?>" id="comment-< ?php comment_ID() ?>">
</li>

Read on..

Posted in: Tutorials, Wordpress on April 2nd, 2008
by: Adam Patterson

WordPress 2.5 = All Good


Wordpress This morning i installed the new WordPress 2.5 and it went without a hitch. Something mush have changed between yesterday and today.

Now i can enjoy the change in scenery. Speaking of scenery, i got my camera back, seams to be in fine working order. I need to get some free time to over the photos that have been sitting in there folders for the past few months.

Also check out http://www.thewonderingphotographer.com/ were i have about 25 images posted, and there is a new one every day. Please comment and rate the photos! Its more for show and tell as well as learning.

Posted in: Wordpress on March 30th, 2008
by: Adam Patterson

WordPress 2.5 RC2 = Not Cool!


WordpressThis morning i installed the new WordPress 2.5 RC after testing it on my dev install with out any issues. This was not the case when i decided to upgrade Studio Lounge. I got a fetal error from a taxonomy.php file and every thing broke, the front end as well as the back end, i was forced to revert back to WordPress 2.3.3. I have logged the error and have no idea why it happened, i only how the issue is fixed by the time it is released.

Posted in: Wordpress on March 28th, 2008
by: Adam Patterson

Ultimate Tag Warrior


wordpressUltimate Tag Warrior seams to break WordPress 2.3 so the tagcloud is more of a drizzle until its updated.

I am using the new internal WordPress Cloud at the moment and it lacks the auto generation that i like, but it seams to be doing the job.

Posted in: Wordpress on October 5th, 2007
by: Adam Patterson

WordPress wp_list_pages Hack


I’m working on a template that was designed to have Tabs and I really didn’t think to much of it, I naturally assumed that it would be possible to add a <span ? tag around the title in the site navigation. Um yea not true. After a bit of searching I found a line in the classes.php in the wp-includes folder that looks like this (around line 517 in version 2.2):

$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . apply_filters('the_title', $page->post_title) . '</a>';

I simply added a tag around the title area and viola it worked like a hot damn.

$output .= $indent . '
<li class="' . $css_class . '"><a title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '" href="' . get_page_link($page->ID) . '"><span>' . apply_filters('the_title', $page->post_title) . '</span></a>';
$output .= $indent . '
	<li class="' . $css_class . '"><a title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '" href="' . get_page_link($page->ID) . '"><span>' . apply_filters('the_title', $page->post_title) . '</span></a>';

Hope this helps.

Posted in: Tutorials, Wordpress on July 11th, 2007
by: Adam Patterson

wp-admin Drop Menu


wp-admin drop menuThis plug in deserves a mention, i tried a drop down plug in a few months ago and was not please with it. it was full of bugs and i promply removed it. but i actually found this one by mistake while looking for a download manager. This one is called “Admin Drop Menus Version 2.0.5” by Yellow Swordfish. There plug in is stylish and fast and supports the latest version of word press currently 2.1

Posted in: Wordpress on January 29th, 2007
by: Adam Patterson

Php Switch with a cookie


The Php Switch is a neat little script. it can be used for a lot of different things. but today we will create a script that will let a user change what style sheet they want and the script will create a cookie to remember the users input.

we can start off by making a few different style sheets. All i did is changed the background colour, you could change whatever you want with these files.

Read on..

Posted in: Tutorials, Wordpress on January 6th, 2007
by: Adam Patterson
Page 1 of 212

Search


Archive


Subscribe