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
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…
Re-register the default genesis sidebar into your function.php. See the image above for html output. genesis_register_sidebar( array( ‘id’ => ‘sidebar’, ‘name’ => __( ‘Primary Sidebar’, ‘genesis’ ), ‘before’ => ‘<div id="%1$s" class="widget %2$s">’, ‘after’ => ‘</div></div>’, ‘before_title’ => ‘<h4 class="widget-title widgettitle">’, ‘after_title’ => ‘</h4><div class="widget-inner">’ ) );
The code snippets you see below should be placed into your theme’s functions.php file. Below is the code to remove the entry meta on your category post. remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
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">’; }…
Genesis Layout Extras Genesis Simple Hooks Genesis Style Trump Genesis Visual Hook Guide
How to get the category ID of the current post? Just copy the codes below and paste it into your .php file. $category = get_the_category( get_the_ID() ); $category_ID = $category[0]->term_id; Another problem is, what if the category ID is a sub category and you need the parent category ID? For Example, the current category ID…