How to make WordPress theme files writable

Change theme files(.css, .php) permissions to 666. 
Path: wp-content/themes/active theme
Don't make everything 777 it's very risky

Sort custom post table rows in wp-admin

add_filter( 'manage_edit-{custom_post_type}_columns', 'edit_custom_columns' ) ;

function edit_custom_columns( $columns ) {
	$columns = array(
		'cb' => '<input type="checkbox" />',
		'title' => __( 'Tite' ),
		'category' => __( 'Category' ),
		'date' => __( 'Date' )
	);
	return $columns;
}

Rename Woo-commerce Order Status Programmatically

function aviweb_renaming_order_status( $order_statuses ) {
    foreach ( $order_statuses as $key => $status ) {
	if ( 'wc-processing' === $key ) {
		$order_statuses['wc-processing'] = _x( 'In progress', 'Order status', 'woocommerce' );
	}
	if ( 'wc-completed' === $key ) {
		$order_statuses['wc-completed'] = _x( 'Delivered', 'Order status', 'woocommerce' );
	}
     }
     return $order_statuses;
}
add_filter( 'wc_order_statuses', 'aviweb_renaming_order_status' );

Custom post type redirect in WordPress

add_action( 'template_redirect', 'aviweb_redirect_post_type' );
function aviweb_redirect_post_type() {
	$queried_post_type = get_query_var('post_type');
	if ( is_single() && 'custom_post' ==  $queried_post_type ) {
		$redirection_url = get_site_url() . '/custom_page';
		wp_redirect( $redirection_url, 301 );
	exit;
	}		
}