Page specific PHP code

Phplugins is very powerful as it can be used to customize your Backlight 2 based site to an extend not possible with the Backlight admin interface. Sometimes, it is not desired, that such a customization targets the entire site, but only a single page or a group of pages. In this short post, I show you how to do this.

First I need a simple helper function to keep my code clear and legible:

As you can see, this can be used to select a single page or several pages on a lower level (eg, galleries) where some page(s) specific code is inserted. On my site I use this add breadcrumbs to my standard pages and to introduce gallery specific code.