layers_get_page_title()

Last Updated:
Back to Main Index

This helper function contains the queries and conditions for generating the page title and is used in tandem with the header-page-title.php partial in static page templates.

Location: core/helpers/template.php

Output

To display the stock  Title Banner, call the partial, not the function directly.

Action

The title banner partial can be injected into any template, custom or existing, as long as a hook exists to support your desired placement. For general use, the layers_after_header hook can be used to insert the partial output between the header and the content wrapper, however traditionally the title banner comes after the wrapper container opening tag.

The following example demonstrates how action hooking can be used to add the title container on all Layers pages that are not the Home page using layers_before_builder_widgets

When using code examples from this site, it is important to use custom callbacks or “function names”. In other words, change my_builder_title to something totally unique, like yourthemename_builder_title . This ensures the code snippet does not cause conflicts or overrides if copied into multiple end products the user may have active at once.

 

Filter

This function can be used as a filter hook to modify the queries set via $title_array.