Hooks/Filter Reference/builder filter title

From IThemes Codex
Jump to: navigation, search

Contents

Description

This filter hook is called in the Builder core's builder_add_title function.

Possible Uses

This filter allows you to easily customize the page title output by Builder. By doing this rather than modifying the header.php file, your modification will work regardless of child theme used.

Parameters

$title
(string) (required) Current title.
Default: Specific page title

Example Use

This example shows how an if statement can be used to provide a custom title on the home page only.

<?php
    // Function to display the custom title
    function custom_filter_title( $title ) {
        if ( is_home() )
            return "Custom Home Page Title";

        // Return the unmodified title on other pages
        return $title;
    }

    // Hook the custom function to the builder_filter_title filter
    add_action( 'builder_filter_title', 'custom_filter_title' );
?>

Commentary

If code hooked to the builder_add_title action provides title output, the builder_filter_title will not be used. If you are using this filter and not seeing the expected output, first make sure that the header.php is calling the builder_add_title function and that nothing is providing a title via the builder_add_title action.


Back to Builder Hooks

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox