Create Custom WordPress Category/Archive Pages

When using WordPress as a content management system, you may find yourself in a situation where you want a parent page to show snippets from each of its child pages. There are a few ways you can go about this.

To begin with, obviously, you need to create the page that will show the list. This should be a standard WordPress page. For purposes of this article, let’s say this page has a title of “Parent.” Once you’ve created the “Parent” page, you can create each of the child pages. Make sure that you indicate each of those pages has “Parent” set as its parent.

Determine Current Page in WordPress

Lately, I’ve been doing a lot of work with WordPress themes. On one particular site, the navigation menu is built dynamically, combining pages and categories in the navigation scheme. I needed to find a way to determine which page or category was currently being viewed so I could apply a special class to the item in the navigation menu, indicating that the link is active.

After a bit of research, I found a couple of useful WordPress functions that helped me determine which page the visitor is currently viewing.