Practical WordPress Development

See All of Your WordPress Page Template Info

For me, one of the minor annoyances with working with WordPress page templates is that you often have to look at a specific page’s edit screen to see what page template it has been assigned.

That is to say that there’s no way to get a global view of the pages and their associated templates.

In order to make it a bit easier, I wrote a quick plugin that makes it easy to see which page template is assigned to a given page on the All Pages screen in the WordPress dashboard.

WordPress Page Template Info

For those who are interested, you can view the source and download a copy of the plugin on GitHub.

The Page Template Info Plugin on GitHub

The Page Template Info Plugin on GitHub

Just as the plugin description reads:

This plugin displays the name of the template associated with each page on the ‘All Pages’ page.

The plugin was developed against 3.8-beta-1 of WordPress, and I’m planning to keep it updated with the most recent version of WordPress; however, there are also a couple of other things that I plan to do with the plugin, as well.

The Plugin in Action

Page Template Info

Page Template Info

Simple enough, isn’t it?

On the All Posts page, it renders the name of the template being used below the title of the page. This makes it much easier than having to drill down to an individual page to check the Page Template meta box to see which template has been used.

Personally, this has been something that’s been useful for me when working on larger sites than the example of, you know, the two pages listed above.

Future Development

As the plugin denotes, this is only `0.1.0`. Over time, I’m hoping to use this particular plugin to test out some object-oriented programming techniques as they relate to WordPress plugin development.

Specifically, I’m interested in doing a better job of applying the SOLID principles and creating a class, say, specifically designed to register actions. I’m also interested in doing a better job of dependency injection, PHP documentation, and so on.

I also need to actually evaluate the code against the new JavaScript Coding Standards, minify it, and make sure everything is up to par.

Regardless, the plugin’s available, and will be under development whenever I have a few minutes to spare on experimenting and improving it.

8 Comments

  1. Adam Dempsey

    Would the information not be better in a new column so you could sort by the template?

    • Tom McFarlin

      Sure – I think that’d be a fine addition.

      Not a bad idea for a future iteration :).

  2. Kel

    Nice and simple!

    Another suggestion – perhaps the Template Name is a dropdown list of the available templates? Otherwise, just clicking the Quick Edit link reveals the template anyway.

    I think Adam’s described the “Codepress Admin Columns” plugin – but that doesn’t allow sorting unless you upgrade to the Paid version. Plus, it’s not as niche as your plugin.

    (Small nit: You mention, “On the All Posts page, it renders…” – it’s actually the All Pages page.)

    Thanks.

    • Tom McFarlin

      Cool – thanks for the suggestions (and the heads up on the typo :))

  3. Richard

    Hi! I was wondering why you haven’t uploaded this to the repo yet, seems like it’d be useful for folks! Are you wanting to clean it up first before putting in in the repo?

    • Tom McFarlin

      It’s mostly a matter of time and priority.

      Paid projects take priority over free projects, so I normally revisit and work on them as soon as I get chance :).

      • Richard

        Of course, Tom! Well, I’ll start using this myself, and if I have any suggestions, I’ll let you know!

        • Tom McFarlin

          Definitely – and thanks for asking! It’s one of those things that I’d love to get back to, but it just takes more time than I’d like ;).

Leave a Reply

© 2020 Tom McFarlin

Theme by Anders NorenUp ↑