http://www.lancelhoff.com/exclude-categories-from-sidebar-wordpress-2-8/
Posts Tagged ‘WORDPRESS’
Wordpress Plugin: Readers Also Viewed…
I don’t normally mention anything when I add a new WP plugin to this site but this one is very new and quite useful.
While displaying too many plugins can make a blog look cluttered and unprofessional, contextual internal links can increase your pageviews and make your site flow more intuitively.
If you haven’t already grabbed it, download and install a Related Posts plugin and then install the Where Did They Go From Here plugin.
Where Did They Go From Here is very similar to the Amazon list that say something like, People who Bought this Also Bought…
Basically, once installed it can track where users click after they have viewed one of your single posts. Unfortunately.. there is no relationship between this plugin and the Recent Posts plugin so you will often see duplicate links across the two lists.
Installation is routine (follow the instructions on the plugin page) except that the plugin attempts to hook into the WP footer and display itself just before the comments. This type of installation will probably work for most people but I found it to result in a badly displayed page when applied to my severely hacked theme.
The fix is simple however, all I had to do was comment out this line in the plugin:
add_action(’comment_form’,’show_where_they_go’);
And add a function call to single.php just above where I placed the Recent Posts call:
<?php show_where_they_go();?>
That was it! The content will start populating once people begin to click away from your single post pages. I highly recommend this plugin!
Clean CSS Customization Method for Wordpress Themes
Chris Pearson does nice work. He posted this article on modifying WP themes a few months ago but if you’re interested in hacking your theme and haven’t read it - take the time. If you’re a CSS ninja you probably already do something like this but if you’re somewhere in between noob and ninja like me this might turn on a lightbulb or two. For more CSS head on over to this CSS guide at Smashing Magazine
I’m Lovin jQuery
Seems that the latest version of Wordpress makes use of jQuery rather than Scriptaculous+Prototype.. Check out some live examples of jQuery in action.
Wordpress 2.1 Pages Return 404 Because of Sidebar Plugin
I upgraded my Wordpress installation to 2.1 the other day from 2.0. Normally I don’t bother with keeping my software so up-to-date but I had heard some good things about the newest version. After upgrading everything appeared to be working correctly except for some of my pages.
The link exchange page worked fine but the other pages returned a WP 404 message. I created a new page as a test to see if maybe I could just get away with redoing the 4 or so other pages from scratch but that didn’t work either.
What’s going on?
After some digging on the web I came across a wordpress support thread suggesting that the issue might be Kates Gasis’ Sideblog Plugin (which I’m using to populate the ‘distractions‘ list). I haven’t had a problem with this plugin in the past while this bug appears to be documented, I was using Kates’ 3.7 release which is supposed to address this issue (didn’t work for me.. and sorry no time to debug).
According to the above WP support thread, someone identified the cause of this issue to be centered around the default post category. Hmm that’s odd, I didn’t think pages had any association to categories…
Well I stand corrected. After looking at the wp_post2cat table, Read More
How To: Widen Your Kubrick Wordpress Theme
Although I plan on creating my own theme whenever I stumble across some free time, the default Kubrick theme that came with WP suits my needs just fine for now.
Lately I’ve been finding myself wanting to take advantage of the entire width of my blog screen. Elements that get in the way of accomplishing this are obviously the sidebar but also the column width as defined in the CSS.
Fortunately we can take care of that with a simple Page Template. If you’d like to create the occasional wide page and use your existing blog width, read my article on creating a Page Template.
Still Need More Space?
Alright, we still need more room for things like Amazon’s astore so let’s widen our standard Kubrick width from 760 to 800.
Note: Take note of the 40px increase as we’ll use that to adjust div padding and such.
As always, be sure to backup your CSS file (default: styles.css) just in case. I’ll present the following steps in an order you can follow if modifying a production site for minimal disruption.
Modify Some Graphics
Using your favorite editor or even MS Paint, open the following files and increase the image attributes to your desired width.
- kubrickbg.jpg
- kubrickbgwide.jpg (this might only be present if you’ve installed the sidebar widget)
- kubrickfooter.jpg
- kubrickheader.jpg
Once that is done, extend the image length by cutting off the right size and moving it to the new “right side”. Then copy a middle section of the image and paste it to fill the hole left behind by your initial cut.
If someone knows of an easier way of accomplishing this please share. All it all it isn’t very difficult at all anyway.
Save the new files as a name you’ll recognize to associate with your new width like *_800.jpg or .png (e.g., kubrickheader_800.jpg).
Note: If using MS Paint, you might want to save the image as a PNG to avoid the default JPG dithering that Paint applies to new files.
Edit The CSS
Using the standard Kubick Stylesheet, there are only a few CSS elements you’ll need to modify. Modify your style.css doc by navigating to Read More
How To: Create a custom WP page template
If you know what to look for, creating Page Templates in Wordpress is very straightforward and easy. Here are some simple instructions.
Beginning The Page Template
What you need to do is to create a custom page template. Open the page.php template file in your themes directory and save it as your desired template file (i.e., fullpage.php).
Next you need to add a commented header like the following to the top of your template file so that WP will know it’s actually a template.
<? /* Template Name: FullPage */ ?>
Modifying Your Custom Template
Once you’ve done the above, hack the content to your heart’s desire. I created a new column style in the CSS to have better control over the display.
Here’s what the rest of my page ended up looking like (below the template comment):
<?php get_header(); ?>
<div id="content" class="fullcolumn">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="entry">
<?php the_content('<p class="serif">
Read the rest of this page »</p>');?>
<?php link_pages('<p><strong>Pages:</strong> '
, '</p>', 'number');?>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
</div>
<?php get_footer(); ?>
Additional Resources
- See it in action: Amazon aStore
WordPress: Creating a Static Directory
While I’m very happy with how WordPress2 handles dynamic page generation with customized permalinks and the like, that doesn’t quite suite my needs for storing static content in a “real” directory.
From time to time I find myself wanting to drop files into a directory under the root location of WordPress. Occasionally it’s nice to upload and link to source code, compressed archives, demo applications or even just random files.
If you’ve ever tried this you realize of course that Wordpress assumes all links coming to anything at or below the root location is a link it should dynamically handle and generate appropriately. As such, creating a location such as “…\mydirectory” under the WP root will result in WP 404 message.
Static Jack
I tried out Jack Born’s “Static Jack” plugin which is supposed to allow you the ability to basically add a redirect rule for static pages.
This worked find for a while but when I leaned on it a bit I found that it wasn’t quite designed to accomplish what I needed. Don’t get me wrong, I think this is a great plugin (thanks Jack) but it wasn’t specifically made to address my particular need.
The plugin handled a few things differently than I desired such as not being 100% compatible with IE and not allowing the browser to render txt documents correctly.
Present Solution
While I didn’t necessarily look forward to messing with the .htaccess file, I knew that the problem could probably be solved with inserting a line or two. Thanks to a helpful article by Håvard Stranden, the line I ended up adding was:
RewriteCond %{REQUEST_URI} !^/mydirectory/?
Adding the /? after “mydirectory” allows any directories beneath it to also serve “static” pages.
The WordPress section of my .htaccess now looks like this
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/mydirectory/? RewriteRule . /index.php [L]
I hope someone else finds this helpful.
Quick Fix for Xanga Crosspost 0.1 Login Issue
Joe Tan has released a number of WordPress plugins available on his site. At present I use a couple of them: the Google Analytics & Feedburner Report and the Flickr Photo Album plugins.
Update: Joe’s latest release has fixed this particular issue. It looks like users might be experiencing a similar problem with ver 0.5 but I am unable to reproduce the error. Keep an eye on Joe’s page for another fix.
It was while browsing these tools that I came across his Xanga Crosspost for Wordpress plugin. I had no idea what Xanga even was or what this plugin did but upon viewing Joe’s Xanga page it became immediately obvious to me how useful the plugin might be. If nothing else perhaps it could leave a crumb trail for increased traffic.
Trouble with Xanga
After downloading and installing the plugin (which was effortless I might add). I then opened the Plugin configuration page to link my Xanga account with my Wordpress installation.
However when I submitted my Xanga username and password I received an “Error: Invalid username or password”. After retyping this several times and then copying and pasting the same credentials I used on Xanga’s site directly it became obvious to me that the problem was not my username or password.
After checking back in at the plugin homepage I noticed 4 recent comments describing the same problem. Something must have changed on Xanga’s end of things. But according to his site, Joe’s out of town for the holidays… if I want this working today it looks like I’ll have to hack it.
