Skip to content

Instantly share code, notes, and snippets.

@mrwweb
Created March 7, 2015 01:16
Show Gist options
  • Save mrwweb/a6011c724e5c8e648222 to your computer and use it in GitHub Desktop.
Save mrwweb/a6011c724e5c8e648222 to your computer and use it in GitHub Desktop.
adding fpw facets via a genesis hook (this isn't working, they appear but show 0 results)
<?php
/* add custom sidebar content */
add_action( 'genesis_sidebar', 'hai_resource_library_sidebar' );
function hai_resource_library_sidebar() {
if( is_post_type_archive( 'hai_resources' ) && class_exists( 'FacetWP' ) ) {
echo '<h2>Filter & Search</h2>';
echo '<label>Search: ' . facetwp_display( 'facet', 'library_search' ) . '</label>';
echo 'Countries: ' . facetwp_display( 'facet', 'countries' );
echo 'Topic Areas: ' . facetwp_display( 'facet', 'topic_areas' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment