Archive for the ‘WordPress’ Category

Link Page Template

Tuesday, June 22nd, 2010

I don’t often use the link or “blogroll” feature of Wordpress, but when I do I want to dedicate some space for it. Making it a page instead of just a sidebar widget. To do this you need to create a template to select from ‘Edit Page’ (the right hand sidebar of the page).

The key code in the whole matter is:

<?php wp_list_bookmarks(); ?>

Which in this example I put directly after the content. This way you can write a little page description before the links display. The links are displayed using unordered lists so make sure to style those out accordingly! Here’s a page I made for the Twenty Ten theme, new for Wordpress 3.0. Although you can use this with any theme.

<?php
/*
Template Name: Links
*/
get_header();
?>

<div id="container">
<div id="content" role="main">

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_front_page() ) { ?>
<h2><?php the_title(); ?></h2>
<?php } else { ?>
<h1><?php the_title(); ?></h1>
<?php } ?>

<div>
<?php the_content(); ?>
<?php wp_list_bookmarks(); ?>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span>', '</span>' ); ?>
</div><!-- .entry-content -->
</div><!-- #post-## -->

<?php endwhile; ?>

</div><!-- #content -->
</div><!-- #container -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Slideshow Gallery Plugin – Exclude Fix

Friday, February 26th, 2010

Excluding attachments with this plugin is a great new feature with 1.0.5. Sadly it doesn’t work right out of the bag and you’ll have to make some easy adjustments to the main slideshow_gallery.php

Look for this:

$a = 0;
foreach ($attachments as $id => $attachment) {
  $a++;
  if (in_array($a, $exclude)) {
	unset($attachments[$id]);
  }
}

Exchange with this:

foreach ($attachments as $id => $attachment) {
  if (in_array($id, $exclude)) {
	unset($attachments[$id]);
  }
}

Slideshow Gallery Plugin – overlapped image fix

Thursday, February 25th, 2010

I love this plugin. I really do:  http://wordpress.org/extend/plugins/slideshow-gallery/

But I hate how when I have multiple sizes of images for my slideshow the old image is peaking underneath the latest image. So I figured I should look into it and see if there was a quick fix and there was. To remove the old image once the rotation begins.

Here’s how you do it:

  1. Move /slideshow-gallery/js/gallery.js to your hard drive via ftp (or download the plugin to your hard drive.)
  2. Goto line 124 in your favorite text editor (Note: Using version 1.0.4) Change:
  3. if(m.length > 2){

    to  

    if(m.length > 1){
  4. Save, upload, refresh!

What we’re doing is here changing whether we delete an image based off of there being 2 live images or 1 live image.  A better solution would be to fix the fact it’s adding a black background to the extra width of images, but not to the height of the images. But to me, since the second image fades in so quickly it adds it’s own functional style.

There are a couple of other tweaks this plugin needs to become the über slideshow gallery, I’ll let you know when I look into the next updates.

Line Breaking in Author Description

Tuesday, December 29th, 2009

So I was having the darndest time trying to make an authors description have paragraphs or “line breaks” on them. For some reason calling the description:

$curauth->description

Lumps everything into one big fat paragraph. After some research I found the solution, with the help from my old from wpautop.

<?php echo wpautop( $curauth->description, $br = 1 ); ?>

And that’s all there was to it! Hope this helps anyone out there searching in the ether.

You need better flash!

Get Adobe Flash player