Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #794753

    Hi,

    Here is tutorial about how to create Header as Widget: http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/ with snippets. Thank you a lot – it was very helpfull for me! I created the header and i can see it at the every page of my site.

    But how can i create custom header for one specific page on my site and how to add it at this specific page of my site? I will be very thankful if you would help me.

    Thanks in advance

    Upd: actually i only need to change One or two strings, may be :after could help. But i can’t find out how to get it work. My site adress:
    http://bruge-temp.hostenko.com

    • This topic was modified 7 years, 5 months ago by Yigit.
    #794999

    Hey!

    Please try using the code as following

    add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
    if(is_page(59)){
    	dynamic_sidebar( 'header' );
    }
    }

    You can simply replace “59” page ID with your pages ID so widget will be displayed on header only on that certain page.

    If that is not what you meant, please elaborate on the changes you would like to make :)

    Best regards,
    Yigit

    #795859

    Hey!

    I created custom header using mentioned aproach. And this header now shows on all my pages. What i need now, is to create a new custom (different) header (say ‘header2’) and this header must showing up on specific page (for example at page ID59). So tell me if i correctly understood you:

    1) I must copy-paste this code to functions.php (without removing old one)
    2) Create new header via Appeariance-Widgets named header2
    3) Add to the widget block information.
    5) See my new custom information on this specific page

    Correct?

    • This reply was modified 7 years, 6 months ago by Max Miko.
    #796295

    Hi,

    The steps you listed should work yes, did you try it out and did you have any luck with it?

    Best regards,
    Rikard

    #796633

    Hey, Rikard!

    Yes, this aprouch with little customization worked well for pages.
    But one more question, how to get the same result for WooCommerce single product pages?
    I tried to add ID’s to code – doesn’t work. I tried to add this:

    add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area3' );
    function enfold_customization_header_widget_area3() {
    if(is_product()){
    	dynamic_sidebar( 'header2' );
    }
    }

    also doesn’t work. Tried to add is_category replacing is_product – aslo do not worked.

    What i do wrong?

    #797929

    Hi,

    Instead of is_product use is_single with the product id and let us know if it works

    Best regards,
    Basilis

    #799497

    Hey Basilis!

    Works like a magic! Thanks, for so quick respond! Would be happy, if you explain what to do if i want to do the same for whole category of the products (eg. i have P1, P2, P3 products under category: ‘category-one’). Because it is time consuming to write each ID. I’ve done it already, but in advance it would be helpfull to know.

    But in general my problem is solved, thanks one more time!

    #799499

    Hey!

    Please check out this post – https://docs.woocommerce.com/document/conditional-tags/ to find correct conditional tags :)

    Glad we could help! Let us know if you have any other questions or issues!

    Cheers!
    Yigit

    #800161

    Thanks a lot!

    #800192

    Hi,

    You are welcome! Let us know if you have any other questions and enjoy your weekend :)

    Best regards,
    Yigit

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Header for specific page’ is closed to new replies.