* Template Redirect * Use archive-books.php for all books and 'book-category' taxonomy archives. * @author CCDN * @link https://codexcafe.net * * @param string, default template path * @return string, modified template path * */ function be_template_redirect( $template ) { if ( is_tax( 'book-category' ) ) $template = get_query_template( 'archive-books' ); return $template; } add_filter( 'template_include', 'be_template_redirect' );
Genesis Layout Filter
Below is the code to force Layout Settings:
//* Force content-sidebar layout setting add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' ); //* Force sidebar-content layout setting add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content' ); //* Force content-sidebar-sidebar layout setting add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar_sidebar' ); //* Force sidebar-sidebar-content layout setting add_filter( 'genesis_site_layout', '__genesis_return_sidebar_sidebar_content' ); //* Force sidebar-content-sidebar layout setting add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content_sidebar' ); //* Force full-width-content layout setting add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
Enable Shortcodes in WordPress
Add the codes in functions.php of your main or child theme.
- Enable shortcodes in any text widget area.
add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode');
- Enable shortcodes in excerpts.
add_filter( 'the_excerpt', 'shortcode_unautop'); add_filter( 'the_excerpt', 'do_shortcode');
- Enable shortcodes in description field for archive pages.
add_filter( 'term_description', 'shortcode_unautop'); add_filter( 'term_description', 'do_shortcode' );
- Enable shortcodes in comments.
add_filter( 'comment_text', 'shortcode_unautop'); add_filter( 'comment_text', 'do_shortcode' );
- …..
Show specific category posts to a page | Genesis
Add custom field name and value as follows
Name: query_args
Value: cat=107
here 107 is category ID
How to create new sidebar in Genesis?
The genesis sidebar code which has to be added in functions.php
// Register new sidebar genesis_register_sidebar( array( 'id' => 'Extra-sidebar', 'name' => 'Extra Sidebar', 'description' => 'This is extra sidebar for any purpose.', ) );