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
Get Header Title function custom_category_page_title() { global $wp_query, $wpdb; $category_ = get_query_var('cat'); $current_cat = get_category ($category_); $category_id = $current_cat->term_id; echo '<header class="entry-header">'; echo'<h1 class="entry-title" itemprop="headline">'.get_cat_name( $category_id ).'</h1>'; echo '</header>'; }
Try to read this first WordPress manual update. Step 1: Replace WordPress files Get the latest WordPress zip (or tar.gz) file. Unpack the zip file that you downloaded. Deactivate plugins. Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access). Using FTP or your shell access, upload the…
Design WP Login landing page (wp-login.php, wp-login.php?action=lostpassword,etc.). I’d like to share some CSS code for you, you can enhance it on your own and this is just an example of mine. The 2 screenshot will be the layout output in WP login landing page. Copy the PHP code to your functions.php of your current WordPress…
Add Woocommerce product featured image using GeneratePress WordPress theme in few steps. You need to access your functions.php. Either on a parent theme or a child theme. In my case I’m using a child theme so gonna paste the codes below on child themes functions.php Please copy the code below and paste it into your…
jQuery( document ).ready(function($){ if ( document.cookie.indexOf( 'visited=true' ) == -1 ){ var number_of_days = 1; // 1 Day var total_of_days = 1000*60*60*24*number_of_days; var expiration = new Date( ( new Date() ).valueOf() + total_of_days ); document.cookie = "visited=true;expires=" + expiration.toUTCString(); } });
Copy this code to your wp-config.php of your WordPress folder. define( 'WP_CONTENT_DIR', '/home/site-folder/public_html/custom-wp-content-name-content' ); define( 'WP_CONTENT_URL', 'http://site.com/custom-wp-content-name-content' );