1. Home
  2. Knowledge Base
  3. Posts Table Pro
  4. Advanced Usage
  5. Adding post tables to archive pages

Adding post tables to archive pages

While Posts Table Pro is primarily designed to be used on standard WordPress pages, it can also be used on post category/archive pages by overwriting the archive template in your theme. Archive pages are categories, tags, author and date archives.

How to add post tables to the archive template

You can download an example ‘archive.php’ template from this link. This will display a posts table for all ‘archive’ pages in your theme. It’s important to note that this is just an example, and you will need to modify this to work with your theme (for example, changing the surrounding HTML based on the other theme templates).

You should also be aware of the order of precedence with theme templates. For example, if your theme contains both a category.php file and an archive.php file, the category.php one will take precedence, so you will either need to remove the category file or add the posts table code to that file as well.

You may want to modify the shortcode in the template to suit your requirements – for example, to select which columns are displayed. See the rest of this documentation for details.

Automatically displaying a posts table on your archive pages isn’t straightforward and if you’re not comfortable with these instructions then we recommend that you ask your web developer to do it, or send us a support request to get a quote from our customisations service.

Can I use a different shortcode for each category?

The above instructions assume that you’ll have the same shortcode for each category. To dynamically use different shortcodes depending on the current category, you would need to do some extra custom coding.

This falls is outside the scope of our standard plugin support. If you don’t know how to do the required coding, then we recommend that you post a job on Codeable where one of their WordPress experts can quote for the work. Alternatively, get in touch if you’d like a quote from our plugin customizations service.

Was this article helpful?

Related Articles