Here is a plugin to print a list of all your posts by category in Wordpress

Posted by ljmacphee on October 1, 2007 under archives, hack your template, how to, wordpress, wordpress template | 14 Comments to Read

Over time all your posts get buried. If someone visits your blog can that person easily find a post she is looking for? Can someone find a post related to one he is viewing? Wordpress archive pages give you a list of categories and a list of months but no direct links to your posts. You know what they say, 3 clicks and your visitor is gone.

So I wanted an archive that listed all my posts, by category, alphabetically by title. So I started with Frucomerci’s ‘List Posts by Category Plugin for Wordpress and shamelessly hacked his plugin.

The new plugin ArchiveByCategory lists all your published blog posts by category alphabetically.

Download, unzip, upload to your plugin directory and active the plugin.

Oct 17th —————————————————————————–

Ok I’ve been told you’all don’t like hacking your templates. So you can just create a post or page; click the ‘code’ button an add the following line

<!– archivesbycategory –>

Braver folks can follow directions below to hack your template

* thank Rob at Backyard Chickens for letting me know you wanted this.

—————————————————————————————-

Now an archive page is needed. Next you need to hack your template. Open up ‘archives.php’ [ not archive.php ] and find the line

<?php wp_list_categories(’title=0′); ?>

Yours might be slightly different. Remove that line and put in its place:

<?php echo archives_by_category(); ?>

Now all you have to do is create a page - call it ‘Archives’ and select ‘Archives’ as the page template. Nothing else needs to be done but to ‘publish’ the page.

I’ve built in anchor links to the page. It will get very long over time. You will want to create anchor links to each category. ( See How and why you should use anchor links ).

The archives page will update itself with all your news posts as you publish them. Nothing more need be done once this has been set up.

[ check sidebar for newest versions ]
*If you are using Wordpress 2.3 download the ArchivesByCategory V 2.2 I totally cleaned up the MySQL and php and it is easier to read, for you to configure and should run a little faster.

*If you are using an earlier Wordpress version you need ArchivesByCategory V 1.0

If you just want to list one category of posts see:
Plugin to list one category of posts ( WP < 2.3 )
Plugin to create a list of posts for one category ( WP>2.3 )

Hack the Blogger Denim Template Up to Size

Posted by ljmacphee on September 7, 2007 under blogger template, hack your template | Be the First to Comment

Let’s face it 800×600 is more than a little cramped and less than 10% of the population is using 800×600 screens. A bit more real estate on Blogger would be nice. Denim, Stretch Denim, Washed Denim and Stretch Denim Light are nicely hackable templates. It is very easy to change the colors, up load a header picture and no one will recognize it before long.

First back up your template!
Go to your dashboard
->layout
->Template
->Edit HTML
and select Download Full Template.

Now pick your favorite Denim Template
Template
->Pick New Template
Pick any one of the Denim series and hit ‘Save Template’

Go Back to ‘Edit HTML’
There are only 4 lines we will edit on this template:

OLD

#header{
width: 760px;

#content-wrapper{
width: 760px;

#main-wrapper{
width: 464px;

#sidebar-wrapper{
width: 240px;

NEW

#header{
width: 950px;

#content-wrapper{
width: 950px;

#main-wrapper{
width: 580px;

#sidebar-wrapper{
width: 300px;

Then click ‘Save Template’.

View it and see how you like the new look.

You can play around with the main-wrapper width and the sidebar-wrapper width but keep the total of the two 880px.

How to add a Google Calendar to your site

Posted by ljmacphee on July 18, 2007 under blogger, blogger template, hack your template, how to, wordpress | Be the First to Comment

Log onto your Google account and go to GMail.
In the upper left corner is a Calendar link - click it

In the left sidebar is a small link at the bottom ‘Manage calendars’ - click it
Up will come a list of the calendars you’ve created
Click on the link for the calendar you wish to add to your sidebar

Near the bottom you will see a section ‘Calendar Adress:’ and ‘xml’ ‘ical’ ‘html’
Click on the HTML button.

A pop up window will appear and you have two choices. The first is a direct link to your calendar
The second is a ‘configuration tool’ - Click that one

A page will appear with all sorts of details you can select - calendar format, size, &c.
Set things up how you like and click the ‘Update URL’ button.

Code will appear in a box ‘2. Add the calendar HTML to your page’
Highlight and select all the text in that box and paste it into notepad or some other
text tool you like to use.

In Blogger go to Template->Add Page Element->HTML/JavaScript - ‘Add to Blog’
and paste your text into the box and save

In Wordpress, go to Presentation->Themes->Theme Editor and paste it into your sidebar in an
appropriate spot.

Or you can just add it to any HTML page by pasting the text where you want the calendar to be.

You can see an example of this at Herself’s Houston Garden

These are useful for websites and blogs about local hobbies where there are events that will interest your readers. Or for blogs about clubs and organizations such as blogs for local photography clubs. Google calendars are nice since people interested in specific events can then just import them to their own Google calendar.

I found I needed to widen the sidebars in the blogs I put calendars into to about 340px. But I’ve been widening websites to 1000px any how since only about 10% of internet users are still using 800×600 displays.

How to create a list of posts from a specific label

Posted by ljmacphee on June 18, 2007 under HTML, blogger, blogger template, hack your template, how to, javascript, wordpress | Be the First to Comment

I needed to make a link list of all the posts relating to specific plants on Herself’s House Plants. I wanted people to be able to quickly scan the list looking for what ever plant they are looking for instead of having them click the specific plant label and load up 60 plant entries. Blogs are a great format for webpages but some information can get buried.

It was a far more challenging task than I planed. I still do not have a good way to do this. This is a two step hack. You can see it Herself’s House Plants here. About mid way down the side bar is a lengthly list of links to specific plants. You can also see a list of Topics in AI on the sidebar of Herself’s AI.

This is how I did it.

Step 1:
You need to create a feed that will fetch only the items from that label. I learned how to do so at Purple Moggy’s There are several feed instructions and examples there so if my example doesn’t do what you need check those out.

Feed URL

Replace {BLOG ID} and {LABEL} with your information

http://beta.blogger.com/feeds/{BLOG ID}/posts/full/-/{LABEL}

The Feed URL I used (wrapping to fit in column):

http://beta.blogger.com/feeds/999999999999999999/posts/
full/-/Specific%20plant%20information?max-results=100

What it took me several hours to figure out:

- use ‘beta.blogger.com’ not your domain or your blogger account

- 999999999999 is your blog id number Detailed directions to find your blog id number. You will see it in the url when you are logged in and working on posts etc. (?blogID=1234567890123456&post )

- Specific%20plant%20information This is your label, put %20 in place of any spaces.

-?max-results=100 This is the maximum urls you would like in the list. I only have 60 or so plants so 100 is more than I need.

That actually was the painful part. Once you have your feed test it in GReader or some place and make sure you have it correct.

Second Step:
You need a JavaScript to process the list. I used the one from Cut n’ Past JavaScript RSS Feed here. There are thousands of JavaScript from feed tools all over the net. If you have a favorite place use that one.

Then you just paste the JavaScript into a HTML/JavaScript element in your template.

Wordpress
For Wordpress the feed for a specific category:
http://www.yourwebsite.com/wordpressDirectory/category/CategoryName/feed/

category and feed are fixed, you have to customize to match your blog and category:
www.yourwebsite.com
wordpressDirectory
CategoryName

Then you will need to place the JavaScript some where in your sidebar template. Work on a copy of your template, they are fragile.

There is also a Wordpress plugin to show information from certain categories I have not tried it. I just ran across the information while researching how to do the category feed.

* If I can figure out a way to do this with out relying on a third party JavaScript/RSS processing place I’ll come back to here and post the directions.