Technology Insights

Modify The WordPress Pages Widget to Include Pages Instead of Exclude Pages

Recently I was setting up a WordPress blog and needed to use the default pages widget to list a certain set amount of pages. On this blog I used the NextGEN Gallery for dozens of different galleries. The issue was that I wanted to only list a couple of pages using the default Pages widget and when using NGG I would have dozens if not hundreds of pages that I would need to exclude with the default Pages widget. So what I needed to do was include a couple of page ID’sĀ instead of excluding hundreds of page ID’s.

The problem above can be accomplished by making one minor adjustment to one WordPress file. We will need to modify the wp_pages_widget PHP function to include the pages specified in the admin versus excluding them.

File to Modify: <wp-root-directory>/wp-includes/widgets.php
Line: 682

Technology Errors

WordPress HighSlide Plugin Error: ‘hs’ is undefined

When integrating Highslide with your WordPress blog there are numerous additions that need to be made outside of actually installing the plugin. First you need to make sure that you have the highslide.css file located in the /wp-content/plugins/highslide/ directory. After that you need to make sure that you add the code listed below to the footer.php file of your blogs theme.

After doing all of this my site was extremelly slow to load. It was taking over a minute to actually load any page that had thumbnails on it. After some debugging I finally noticed a Highslide JavaScript error which is below.

bash

  1. 'hs' is undefined

Technology Insights

How to Upload Files to a WordPress Post

After WordPress 2.5 uploading files to posts has become much easier. When first looking into this I was confused though because I every time I would upload a file it would not automatically link to the file. I was assuming the file did not upload properly and that was the reason there was no file to link to. I was mistaken though and really uploading a file is exactly like uploading an image but you have to select where the file links to. Follow the simple directions below to upload files to a WordPress post on your WP blog. The directions below are based on WordPress 2.7+ however they are very similar to WordPress 2.5/2.6.

  1. Open WordPress Admin: Obviously the first thing you need to do is login to the WP administration area of your blog which is typically found at your URL followed by /wp-admin.

Technology Insights

WordPress JPF Login/Out Plugin Logout Not Working After Upgrading to WordPress 2.7

I use the JPF Login/Out plugin to display text at the top of a WordPress site and after upgrading to WordPress 2.7 the logout link stopped working. After reading in the WordPress Codex it appears that the wp_logout_url was added to provide a nonce-protected URL that can be used during logout.

In the jpf_loginout.php file on line 17 change the below:

php

  1. $link = $before . '<a href="' . get_settings('siteurl') . '/wp-login.php?action=logout">' . $log_yes . '</a>' . $after;