Child Theming

Customizing and Extending the Framework

Introduction

Child themes are intended for extending and customizing the PageLines framework to meet your needs.

You can make any change you need to Platform from a child theme (Base) without editing the framework. This way when PageLines updates the framework you won’t have to worry about losing any custom changes you’ve made.

Template files that are copied into the base theme such as template.postloop.php will take precedence over the same file in the parent theme making it “safe” for editing, while the original code is still maintained.

Functions.php and Base.css

There are two main files in the Base child theme for editing, base.css & functions.php.

  • Function.php – This is wear you put all your customization PHP and hooks
  • Base.css - This is wear you should put all your customization CSS (graphical changes)

Using base.css you can apply custom CSS to your theme. It is in the functions.php file that you can add pretty much anything else.

Using Hooks

Using hooks is pretty easy once  you try it out. To learn about them in detail, please refer to this hooks and filters doc on WordPress.org.

There are instructions, including an example hook already placed in the functions.php file that looks like this:

// add_action('hook_name','function name');
add_action('pagelines_branding_icons_end', 'add_icons_to_branding');

// function name
function add_icons_to_branding(){

// what the function does–in this case adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css
// and is the image from the CSS is placed in the images folder
?>

PageLines Hooks

Using Your First Hook

Section HooksHooks are a way of inserting custom content through the Base child theme so that you don’t have to edit the original template files. This keeps your custom changes safe from core updates. Each template area section has a list of hooks and CSS selectors that apply to that specific section. Just toggle the “Advanced Setup” link to view the hooks, CSS selectors, and default visibility settings.