Jump to content

Custom Templates & Hooks?

Recommended Posts



I'm not sure if I'm missing something but can I add code via hooks in template files the same way I do via the functions file?


For instance, I only want the dummy text "Foo!" to appear when a page is using the "Chapter Houston" template

	Template Name: Chapter Houston


	function asf_chapter_title() {

I can get the code using add_action to work in the functions.php file but not the template. Am I missing something?

Share this post

Link to post
Share on other sites



Adding a child theme or PageLines Customize plugin lets you safely add a hook.  Those can affect a section used on a template, but you cannot write to the template itself, as that's core code.  It would also be a pretty good way to crash the entire site.   Using hooks will allow you to add customizations via the hook and apply it to a section, which is then applied to the template.


Basically, you're getting what you desire, but in a few standard steps.

Former PageLines Moderator, Food Expert and Raconteur

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now