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
Option 1 add_filter( ‘genesis_pre_get_option_site_layout’, ‘genesiscustomlayout’ ); function genesiscustomlayout(){ $pageobj = get_queried_object(); $pageid = absint($pageobj->ID); $pagelayout = get_post_meta($pageid , "_genesis_layout" , true); return $pagelayout; } Option 2 This function is to forced your custom post type content layout to full width. Common post type is post, page, and product ( woocommerce plugin pages ) and etc….
Header hooks and filters Remove site description add_action( ‘genesis_site_description’, ‘genesis_seo_site_description’ ); Custom Logo structure add_filter( ‘genesis_seo_title’, ‘genesis_custom_seo_title’, 10, 3 ); function genesis_custom_seo_title( $title ) { if( get_header_image() ){ $title .= ‘<div class="logo-wrap">’; $title .= ‘<a class="logo-image" href="’.get_bloginfo(‘url’).’" title="’.get_bloginfo(‘name’).’">’; $title .= ‘<img src="’.get_header_image().’" alt="’.get_bloginfo(‘name’).’"/>’; $title .= ‘</a>’; $title .= ‘</div>’; }else{ $title = ‘<h1 class="site-title">’.get_bloginfo(‘name’).'</h1>’; }…
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">’; }…
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…
Hi guys! good day.. I have a very short code here to connect your Woocommerce pages to the genesis sidebar layout. Paste the codes below on your functions.php. NOTE: If the codes below does not work, means your current Woocommerce hooks has been re-locate or Woocommerce hooks has been updated from before structure. # WOOCOMMERCE…
Copy this this on your choosed templates. Locate a file code : locate_template( array( 'function-custom.php' ), true ); Require a file code : require_once( 'functions-custom.php' ); Include a file code : include( 'functions-custom.php' ); Get template functions-woocommerce.php Ex: get_template_part( ‘partials/content’, ‘page’ ); get_template_part( 'functions-woocommerce' );