This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag above | |
add_filter( 'genesis_search_form', 'rvam_search_form', 10, 4); | |
function rvam_search_form( $form, $search_text, $button_text, $label ) { | |
$onfocus = " onfocus=\"if (this.value == '$search_text') {this.value = '';}\""; | |
$onblur = " onblur=\"if (this.value == '') {this.value = '$search_text';}\""; | |
$form = '<form method="get" class="searchform search-form" action="' . home_url() . '/search" >' . $label . ' | |
<input type="text" value="' . esc_attr( $search_text ) . '" name="q" class="s search-input"' . $onfocus . $onblur . ' /> | |
<input type="submit" class="searchsubmit search-submit" value="' . esc_attr( $button_text ) . '" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag above | |
genesis_register_sidebar( array( | |
'id' => 'google-cse', | |
'name' => __( 'Google CSE Page', 'CHILD_THEME_NAME' ), | |
'description' => __( 'This is the widget area of the Google CSE Page Template.', 'CHILD_THEME_NAME' ), | |
) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Template Name: Google CSE | |
* | |
* This file adds the Google SERP template to our Genesis Child Theme. | |
* | |
* @author Rick R. Duncan | |
* @link http://rickrduncan.com | |
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function() { | |
var cx = '007935457329138067308:j8ssm1gufja'; | |
var gcse = document.createElement('script'); | |
gcse.type = 'text/javascript'; | |
gcse.async = true; | |
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + | |
'//www.google.com/cse/cse.js?cx=' + cx; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(gcse, s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag above | |
/** | |
* Alter the Genesis Search form so that we can change the destination page | |
* and our querystring parameter. | |
* | |
* @author Rick R. Duncan | |
* @link http://www.rickrduncan.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* ALL EXAMPLES ON THIS PAGE USE THE NEW HTML5 METHOD | |
//* Remove page titles site wide (posts & pages) (requires HTML5 theme support) | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Change microdata schema when on the About or Contact page. | |
//* http://schema.org/docs/documents.html | |
//* genesis/lib/functions/markup.php | |
add_filter( 'genesis_attr_body', 'rvam_body_schema' ); | |
function rvam_body_schema( $attributes ){ | |
//* Use AboutPage schema on our about page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Remove JetPack's grunion stylesheet used for the contact form | |
function remove_grunion_style() { | |
wp_deregister_style('grunion.css'); | |
} | |
add_action('wp_print_styles', 'remove_grunion_style'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Add Core JS file | |
add_action( 'wp_enqueue_scripts', 'b3m_add_core_js' ); | |
if ( ! function_exists( 'b3m_add_core_js' ) ) { | |
function b3m_add_core_js() { | |
wp_enqueue_script( 'core-js', get_stylesheet_directory_uri() . '/lib/js/core.js', array('jquery'), '1.0.0', true ); | |
} | |
} |