get specific value of a array | PHP

The previous answer is wrong, to access the array elements, you need to get it by the key: $location = $release_edu_qual[0][“location”]; In the above code, we’re getting the location of the array that’s first (zero based) in the initial array. So to list all the array data you want from that initial array you could … Read more

Functions php shortcode for displaying main menu with no child items

You could set the ‘depth’ argument to 1 in your wp_nav_menu() call to get only top level items, along with the custom menu walker, something like this: return wp_nav_menu( array( ‘menu’ => $name, ‘menu_class’ => ‘footer-menu’, ‘echo’ => false, ‘depth’ => 1, ‘walker’ => new custom_footer_menu_walker ) ); Add the custom menu walker to your … Read more

How to create a field in customize and show that in header.php?

add_action( ‘customize_register’, ‘theme_customize_register’ ); /** * Register individual settings through customizer’s API. * * @param WP_Customize_Manager $wp_customize Customizer reference. */ function theme_customize_register( $wp_customize ) { // You can first start by adding a section $wp_customize->add_section( ‘theme_options’, array( ‘title’ => __( ‘Title of your section’, ‘domain’ ), ‘capability’ => ‘edit_theme_options’, ‘description’ => __( ‘Some description’, ‘domain’ … Read more

Remove item in Checkout

that function is deprecated, use wc_get_cart_remove_url( $cart_item_key ) instead if (is_checkout()) { $product_name .= apply_filters(‘woocommerce_cart_item_remove_link’, sprintf( ‘<a href=”%s” rel=”nofollow” class=”remove” style=”float:left;”>&times;</a>’, esc_url(wc_get_cart_remove_url($cart_item_key)), __(‘Remove this item’, ‘woocommerce’), esc_attr($cart_item[‘product_id’]), esc_attr($cart_item[‘data’]->get_sku()) ), $cart_item_key); return $product_name; }