Get the current post parent category ID
How to get the current post parent category ID? Just copy the codes below and paste this your template.
global $post; $category = get_the_category( get_the_ID() ); $parent = $category[0]->term_id
Wrap the genesis footer widgets and footer section by footer wrap. Example: <div class="footer-widgets"></div> <footer class="site-footer" role="contentinfo" itemscope="itemscope" itemtype="http://schema.org/WPFooter"></div> Using the codes below, this will be the output look like. <div class="footer-wrap"> <div class="footer-widgets"></div> <footer class="site-footer" role="contentinfo" itemscope="itemscope" itemtype="http://schema.org/WPFooter"></div> </div> add_action( ‘genesis_before_footer’, ‘footer_wrap_start’, 1 ); add_action( ‘genesis_after_footer’, ‘footer_wrap_end’ ); function footer_wrap_start(){ echo ‘<div id="footer-wrap">’; }…
How to control the post displayed on a specific category? You can solve this problem by simply copy the codes below on your functions.php file. function category_blog_posts_per_page( $query ) { if ( is_admin() || ! $query->is_main_query() ){ return; } if( is_category( 1 ) ){ $query->set( ‘posts_per_page’, 15 ); } } add_action( ‘pre_get_posts’, ‘category_blog_posts_per_page’, 1 );
Default function add_filter( ‘get_search_form’, ‘genesis_search_form’ ); function genesis_search_form() { $search_text = get_search_query() ? apply_filters( ‘the_search_query’, get_search_query() ) : apply_filters( ‘genesis_search_text’, __( ‘Search this website’, ‘genesis’ ) . ‘…’ ); $button_text = apply_filters( ‘genesis_search_button_text’, esc_attr__( ‘Search’, ‘genesis’ ) ); $onfocus = "if (‘" . esc_js( $search_text ) . "’ === this.value) {this.value = ”;}"; $onblur =…
Catchable fatal error: Argument 1 passed to Genesis_Admin_CPT_Archive_Settings::__construct() must be an instance of stdClass, instance of WP_Post_Type given, called in /home/…/wp-content/themes/genesis/lib/admin/menu.php on line 122 and defined in /home/…/wp-content/themes/genesis/lib/admin/cpt-archive-settings.php on line 38 This error is sometimes showing after updating the WordPress. It is advice to update your Genesis theme first before the WordPress. To fix this…
Remove the ” <p></p> “ on the footer add_filter( ‘genesis_footer_output’, ‘footer_remove_p’ ); function footer_remove_p( $output ){ $output = ”; } Default functions <?php /** * Genesis Framework. * * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form…
Remove ” Edit ” page / post link when logged in add_filter( ‘genesis_edit_post_link’, function(){ return false; }); Default functions <?php /** * Genesis Framework. * * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form of a child…