Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource



Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


Make Template?

Templates are Pens that can be used to start other Pens. You can view all of your templates, or learn more in the documentation.


Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.


                // Add a new checkout field
function kia_filter_checkout_fields($fields){
    $fields['extra_fields'] = array(
            'related_grant' => array(
                'type' => 'text',
                'required'      => false,
                'label' => __( 'Turnover related grant ' )
            'diocesan_president' => array(
                'type' => 'text',
                'required'      => false,
                'label' => __( 'Diocesan President ' )
            'rep_account_number' => array(
                'type' => 'text',
                'required'      => false,
                'label' => __( 'Reps account number ' )
             'diocese' => array(
                'type' => 'select',
                'required'      => false,
                'label' => __( 'Diocese ' )

    return $fields;
add_filter( 'woocommerce_checkout_fields', 'kia_filter_checkout_fields' );

// display the extra field on the checkout form
function kia_extra_checkout_fields(){ 

    $checkout = WC()->checkout(); ?>

    <div class="extra-fields">
    <h3><?php _e( 'Additional Fields' ); ?></h3>

    <?php foreach ( $checkout->checkout_fields['extra_fields'] as $key => $field ) : ?> 

            <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>

        <?php endforeach; ?>

<?php }
add_action( 'woocommerce_checkout_after_customer_details' ,'kia_extra_checkout_fields' );
add_action( 'woocommerce_after_customer_login_form' ,'kia_extra_checkout_fields' ); 
add_action( 'woocommerce_after_my_account' ,'kia_extra_checkout_fields' ); 

// save the extra field when checkout is processed
function kia_save_extra_checkout_fields( $customer_id, $posted ){
    if( isset( $posted['related_grant'] ) ) {
        uupdate_user_meta( $customer_id, '_related_grant', sanitize_text_field( $posted['related_grant'] ) );


     if( isset( $posted['diocesan_president'] ) ) {
        update_user_meta( $customer_id, '_diocesan_president', sanitize_text_field( $posted['diocesan_president'] ) );

     if( isset( $posted['rep_account_number'] ) ) {
        update_user_meta( $customer_id, '_rep_account_number', sanitize_text_field( $posted['rep_account_number'] ) );

      if( isset( $posted['rep_account_number'] ) ) {
        update_user_meta( $customer_id, '_diocese', sanitize_text_field( $posted['diocese'] ) );
add_action( 'woocommerce_checkout_update_order_meta', 'kia_save_extra_checkout_fields', 10, 2 );

// display the extra data on order recieved page and my-account order review
function kia_display_order_data( $customer_id ){  ?>
    <h2><?php _e( 'Additional Info' ); ?></h2>

              <p> <?php _e( 'Turnover related grant:' ); ?>              
              <?php echo update_user_meta( $customer_id, '_related_grant', true ); ?>  </p>

                   <p>  <?php _e( 'Diocesan President:' ); ?>                
              <?php echo update_user_meta( $customer_id, '_diocesan_president', true ); ?></p>

                 <p>    <?php _e( 'Reps account number:' ); ?>              
              <?php update_user_meta( $customer_id, '_rep_account_number', true ); ?>  </p>

                <p>     <?php _e( 'Diocese:' ); ?>              
              <?php echo update_user_meta( $customer_id, '_diocese', true ); ?>  </p>

<?php }

add_action( 'woocommerce_thankyou', 'kia_display_order_data', 20 );
add_action( 'woocommerce_view_order', 'kia_display_order_data', 20 );

// display the extra data in the order admin panel
function kia_display_order_data_in_admin( $order ){  ?>
    <div class="order_data_column">
        <h4><?php _e( 'Extra Details', 'woocommerce' ); ?></h4>
            echo '<p><strong>' . __( 'Turnover related grant' ) . ':</strong>' . update_user_meta( $user_id, '_related_grant', true ) . '</p>'; 
            echo '<p><strong>' . __( 'Diocesan President:' ) . ':</strong>' . update_user_meta( $user_id, '_diocesan_president', true ) . '</p>';
            echo '<p><strong>' . __( 'Reps account number' ) . ':</strong>' . update_user_meta( $user_id, '_rep_account_number', true ) . '</p>';
            echo '<p><strong>' . __( 'Diocese' ) . ':</strong>' . update_user_meta( $user_id, '_diocese', true ) . '</p>';


<?php }
add_action( 'woocommerce_admin_order_data_after_order_details', 'kia_display_order_data_in_admin' );




There are 10 kinds of people, those who understand binary and those who don’t.