Monthly Archives: November 2010

Align Posts in a Row, aka Posts in Columns

If you want to have several posts in a row across the page, you can use code similar to this. This code is an example.  You will need to customize it to your theme.

The important things to note are:

  • the use of $post_counter to create the divs for each row
  • the creation of a div with class=”post_class” to contain each post
  • the use of CSS to set the width of post_row and post_class

You will need to add the CSS to float the posts left, set the width, and probably set some margins.  There is some sample CSS following the code.  Continue reading

Page Links To Plugin, aka Categories on a Page

How do I show a Category on a Page? Or, for that matter, how do I link to anything I want? This question comes up regularly on the Support forums.

The question really breaks down into two parts:

  1. How do I show categories on a page?
  2. How do I keep from duplicating the posts on the Home/Blog page?

There are several ways to do this, depending on your theme and the version of WordPress you are using. Continue reading

Pagination Using paginate_links()

There are often posts on the WP Support forum asking how to paginate a custom query or an array. Here is a link to an article with one solution: Pagination Without Using A Plugin

The code below shows an example of using the built-in WP function paginate_links() for this purpose. Continue reading

Add a Tag to each Post in a Category

A WP user had a large number of posts in a certain category.  They wanted to add a tag to each post in that category.  Here is the procedure to do that with SQL commands.  Continue reading