Skip to main content

How to customize header part of storefront theme in wordpress?

Solution: 

You can easily customize storefront theme from functions.php of storefront child theme.
With the help of storefront_header hook you can do that.

The following code is used to remove storefront header default features-

add_action("after_setup_theme", "storefront_child_header_remove");
function storefront_child_header_remove()
{
    remove_action("storefront_header","storefront_site_branding",20);
    remove_action("storefront_header","storefront_secondary_navigation",30);
    remove_action("storefront_header","storefront_product_search",40);
    remove_action("storefront_header","storefront_primary_navigation_wrapper",42);
    remove_action("storefront_header","storefront_primary_navigation",50);
    remove_action("storefront_header","storefront_header_cart",60);
    remove_action("storefront_header","storefront_primary_navigation_wrapper_close",68);
}


Description

When your theme is ready storefront_child_header_remove() function is called and this function call each remove_action function to remove those functionality that you dont want.

You can also easily add your own function in the header part using the same hook "storefront_header" . For example suppose you want to execute your function before storefront_product_search function execution then the following code works -


add_action("storefront_header","my_custom_function",35);
function my_custom_function()
{
   // Your code here
}


Here 35 is the priority that tells the function to execute before storefront_product_search function execution whose priority is 40.

Comments

  1. A9D8AGregory7583A15 April 2024 at 12:22

    75632
    ----
    ----
    ----
    ----
    matadorbet
    ----
    ----
    ----
    ----

    ReplyDelete

Post a Comment

Popular posts from this blog

Algorithm, Flowchart and Program code to print the larger of two numbers

       Q. Write a program in C to print the larger of two numbers with                t he  help of   algorithm and flowchart.        Algorithm:        Step 1: Start       Step 2: Read a, b .        /* a, b two numbers */        Step 3: If a>b then        /*Checking */                       Display “a is the largest number”.                   Otherwise                       Display “b is the largest number”.   Step 4: Stop.     Flowchart  :     Program:       Output:  

How to add TextBox to display product price inside woocommerce single product page?

Adding TextBox to display product price inside woocommerce single product page -  Step -1 :  Write the following code inside your functions.php file -  add_action( 'woocommerce_after_add_to_cart_quantity', 'woocommerce_total_product_price', 31 ); function woocommerce_total_product_price() {       ?>      <input type="hidden" class="product-currency" value=<?php echo get_woocommerce_currency_symbol()?> />     <input type="text" id="product_total_price" readonly="readonly">     <input type="hidden" id="calculate_product_total_price" >     <?php } Step - 2 :  Create a js file as "test.js" and write the following code inside "test.js" file - jQuery(function($) {     /* Clearing product price textbox and hidden price textbox when clear link is clicked */   $('.reset_variations').on('click...