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, I have this problem during my WordPress coding journey. The `get_the_ID()` has conflict in nested `WP_Query` codes. On the first `WP_Query` loop, the ID for example is 20, then inside that loop I have another `WP_Query` (see the codes below) that makes the `WP_Query` codex more completed if you don’t code it right….
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…
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">'; }…
Watch One Piece Episode 787 English Subbed below. Video is coming Soon!!!
jQuery('.wdes-popup-title').click(function(){ jQuery(jQuery(this).attr('content-id') + ' iframe' ).attr('src', id[jQuery(this).attr('content-id').replace('#','')] ); }); var id = {}; jQuery('.wdes-popup-close').click(function(){ console.log(jQuery(this).closest('.wdes-popup-main').attr('id')); if( ! id[jQuery(this).closest('.wdes-popup-main').attr('id')] ){ id[jQuery(this).closest('.wdes-popup-main').attr('id')] = jQuery('#' + jQuery(this).closest('.wdes-popup-main').attr('id') + ' iframe' ).attr('src'); } jQuery('#' + jQuery(this).closest('.wdes-popup-main').attr('id') + ' iframe' ).attr('src', ''); });
How Convert string with unwanted character to slug, proper name, etc.? Try this code using http://phptester.net/. // Example 1 function cleantitle($string){ $string = str_replace(' ', '-', $string); $string = preg_replace('/[^A-Za-z0-9\-]/', '-', $string); return preg_replace('/-+/', ' ', $string); } $str_1 = 'Menstruation_Sisters_-_14'; echo cleantitle($str_1); // output will be "Menstruation Sisters 14" // Example 2 function cleantitleslug($string){…