Skip to content

Instantly share code, notes, and snippets.

View bhubbard's full-sized avatar
:octocat:
Hello

Brandon Hubbard bhubbard

:octocat:
Hello
View GitHub Profile
<?php
// This breaks Genesis, due to body class hooks (needs if statement)
function idxbroker_wrappers_wpbody_class_names( $classes) {
if ( 'idx-wrapper' == get_post_type() ) {
return array('idxbroker idxbroker-dynamic-wrapper dynamic-wrapper-'.get_the_title().'' );
} else { }
}
add_filter('body_class','idxbroker_wrappers_wpbody_class_names');
<ul>
<li><a href="#a">A</a></li>
<li><a href="#b">B</a></li>
<li><a href="#c">C</a></li>
</ul>
<hr />
<h3 id="a">A</h3>
<a class="houzz-share-button"
data-url="http://www.yoursite.com/product/page/ "
data-hzid="Your HZID"
data-title="Product Title as it will be seen inside Houzz "
data-img="http://yoursite/path/to/product/image.jpg "
data-desc="Product description text "
data-category="Category keywords "
data-showcount="1 "
href="https://www.houzz.com">Houzz</a>
<script>(function(d,s,id){if(!d.getElementById(id)){var js=d.createElement(s);js.id=id;js.async=true;js.src="//platform.houzz.com/js/widgets.js?"+(new Date().getTime());var ss=d.getElementsByTagName(s)[0];ss.parentNode.insertBefore(js,ss);}})(document,"script","houzzwidget-js");</script>
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
/**
* Sets noindex for the wpengine author archive pages.
*
* @access public
* @return void
*/
function noindex_wpengine_author() {
if (is_author( 'wpengine' )) {
echo '<meta name="robots" content="noindex">';
<?php
if ( defined('IS_WPE_SNAPSHOT') && IS_WPE_SNAPSHOT ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
}
<?php
/* Hook to 'add_meta_boxes' with lower priority. */
add_action( 'add_meta_boxes', 'idxbroker_remove_wpseo_metabox', 11 );
/**
* Remove WordPress seo meta box.
*/
function idxbroker_remove_wpseo_metabox() {
if ( get_post_type() == 'idx-wrapper' ) {
remove_meta_box( 'wpseo_meta', 'idx-wrapper', 'normal' );
remove_meta_box( 'sharing_meta', 'idx-wrapper', 'advanced');
function dj_modify_num_posts_for_testimonials($query)
{
if ($query->is_main_query() && $query->is_post_type_archive('testimonials') && !is_admin())
$query->set('posts_per_page', 20);
}
add_action('pre_get_posts', 'dj_modify_num_posts_for_testimonials');
<?php
// Always add idx tags to wrappers
add_filter ('the_content', 'idxbroker_add_idx_tags', 99);
function idxbroker_add_idx_tags($content) {
global $post;
$idxstart = '<div id="idxStart" style="display: none;"></div>';
$idxstop = '<div id="idxStop" style="display: none;"></div>';
<?php
// Always add idx tags to wrappers
add_filter ('the_content', 'idxbroker_add_idx_tags', 99);
function idxbroker_add_idx_tags($content) {
global $post;
$idxstart = '<div id="idxStart" style="display: none;"></div>';
$idxstop = '<div id="idxStop" style="display: none;"></div>';