Hooks/Action Reference/builder add meta data

From IThemes Codex
(Difference between revisions)
Jump to: navigation, search
 
(12 intermediate revisions by 2 users not shown)
Line 11: Line 11:
 
To supply a custom meta output, the default function can be replaced with a custom one. The following could be added to a [[Child Theme|child theme's]] [[functions.php]] file in order to provide the customized meta tags:
 
To supply a custom meta output, the default function can be replaced with a custom one. The following could be added to a [[Child Theme|child theme's]] [[functions.php]] file in order to provide the customized meta tags:
  
<pre>remove_action( 'builder_add_meta_data', 'builder_seo_options' );
+
<pre class="brush:php">
add_action( 'builder_add_meta_data', 'custom_builder_seo_options' );
+
<?php
 
+
remove_action( 'builder_add_meta_data', 'builder_seo_options' );
function custom_builder_seo_options() {
+
add_action( 'builder_add_meta_data', 'custom_builder_seo_options' );
    /* Custom output code */
+
}</pre>
+
function custom_builder_seo_options() {
 +
/* Custom output code */
 +
}
 +
?>
 +
</pre>
  
 
----
 
----
Back to [http://ithemes.com/codex/page/Category:Builder_Hooks Hooks]
+
Back to [[Builder_Hooks|Builder Hooks]]
[[Category:Actions]]
+

Latest revision as of 04:58, September 2, 2010

Contents

Description

This action hook is called in the Builder core's header.php template file inside the head tag. By default, the builder_seo_options function is attached to this action, which outputs a series of meta tags to add additional information about the current page view.

Possible Uses

This action could be used to tie in any logic that needs to run or output inside the head tag. However, in general, it is better to use the wp_head action if you simply need to run some code inside the head tag. Thus, the use of this action is best kept limited to modifying the meta tag output for the page.

Parameters

None

Example Use

To supply a custom meta output, the default function can be replaced with a custom one. The following could be added to a child theme's functions.php file in order to provide the customized meta tags:

<?php
	remove_action( 'builder_add_meta_data', 'builder_seo_options' );
	add_action( 'builder_add_meta_data', 'custom_builder_seo_options' );
	
	function custom_builder_seo_options() {
		/* Custom output code */
	}
?>

Back to Builder Hooks

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox