Blog

Archive for the ‘Wordpress’ Category

How to change the default jQuery version used by WordPress

Sunday, June 27th, 2010

To override the default jQuery version called by Wordpress from 1.3.2 to 1.4.2:

In your theme’s function.php file, Paste this code:

if( !is_admin()){
   wp_deregister_script('jquery');
   wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"), false, '1.4.2');
   wp_enqueue_script('jquery');
}

Wherever you see ‘1.4.2′, you can replace that with whatever wordpress version you are using.

This has been tested in Wordpress 2.9.2

How to create a sidebar navigation in Wordpress

Wednesday, February 3rd, 2010

Here’s a snippet that will give you an instant sidebar navigation in Wordpress. It grabs the post parent title and the children of that parent.

Download wordpress-sidebar-nav.txt

< ?php
$parent_title = get_the_title($post->post_parent);
$permalink = get_permalink($post->post_parent);
if($post->post_parent) {
$children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0');
}
else {
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
}
?>

< ?php if ($children): ?>


< ?php endif; ?>
  • Blog Home