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
If this is happening on your end, try this troubleshooting. Check if your Gravity Form short code if is placed outside the wp_footer();. I guess the short code does not support any function outside the wp_footer();. You should put your Gravity Form short code before wp_footer();. Much better if it is placed on inside the…
Get current posts parent category ID, permalink, name, etc via codes below. $ac_category = get_the_category( get_the_ID() ); // Use print_r($ac_category); to see all data. It includes name, slug, etc. echo esc_url( get_category_link( $ac_category[0]->term_id ) ); // this will show a category permalink
How to update BuddyPress cover image size? Just copy and paste the codes below to your functions.php add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'swifter_xprofile_cover_image', 10, 1 ); function bp_legacy_theme_cover_image_css_2( $settings = array() ) { $theme_handle = 'bp-child-css'; $settings['theme_handle'] = $theme_handle; $settings['callback'] = 'bp_legacy_theme_cover_image_2'; return $settings; } function bp_legacy_theme_cover_image_2( $params = array() ) { if ( empty( $params ) )…
If you encountered the same error just like the image above, just follow this instructions. Open your wp-config.php in cpanel and add this code. define( 'WP_MEMORY_LIMIT', '128M' );
PHP Notice: unserialize(): Error at offset of bytes is showing when you edited the serialized text. In my end, I have serialized text and change the text. This will mess up serialized character count. This error show on my end `PHP Notice: unserialize(): Error at offset 2025 of 3529 bytes` and to fix the issue,…
str_replace( array( '<', '>', '/', ',', '{', '}', '?', '*' ), '', $value[0]->post_content )