Run a code only on theme activation only during first activation

function clearwidgets(){   //stuff here only runs once, when the theme is activated for the 1st time }  register_activation_hook(__FILE__, 'clearwidgets'); 

And the code I am trying to execute is this:

    add_filter( 'sidebars_widgets', 'unset_sidebar_widget' );  function unset_sidebar_widget( $  sidebars_widgets ) { unset( $  sidebars_widgets[ '$  sidebar_id' ] ); return $  sidebars_widgets; } 

That means when the first time the theme is installed it should clear away all the default widget set by WordPress.

Where am I going wrong because the desired result is not achieved? Please suggest me the fix or direct me in the direction so that I can troubleshoot.

style.css file in child theme doesn’t work

I have created a child theme for my WordPress theme. I have created a style.css and functions.php file, but it doesn’t work on my website and I guess this is my functions.php file problem…

  • Enqueue styles. */ function kava_child_styles_depends( $ deps ) {

    $ parent_handle = ‘kava-parent-theme-style’;

    wp_register_style( $ parent_handle, get_template_directory_uri() . ‘/style.css’, array(), kava_theme()->version() );

    $ deps[] = $ parent_handle;

    return $ deps; }

style.css file in child theme doesn’t work

I have created a child theme for my WordPress theme. I have created a style.css and functions.php file, but it doesn’t work on my website and I guess this is my functions.php file problem…

  • Enqueue styles. */ function kava_child_styles_depends( $ deps ) {

    $ parent_handle = ‘kava-parent-theme-style’;

    wp_register_style( $ parent_handle, get_template_directory_uri() . ‘/style.css’, array(), kava_theme()->version() );

    $ deps[] = $ parent_handle;

    return $ deps; }

[GET][NULLED] – REHub – Directory, Shop, Coupon, Affiliate Theme v9.1.2

[​IMG]
[​IMG]

[GET][NULLED] – REHub – Directory, Shop, Coupon, Affiliate Theme v9.1.2

how to add link for advance search in magento 2 home page default theme?

i followed this answer

https://magento.stackexchange.com/a/258463/73525

step 1:

{{block class="Magento\CatalogSearch\Block\Advanced\Form" template="Magento_CatalogSearch::advanced/form.phtml"}}

i did it’s showing in home page (advanced search)

but step 2:

If you need to customize phtml, copy it from:

vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml 

where i can copy to my default theme in magento

in my folders

app/design/Magento after this no folder available

how i can do step 2

(i’m using magento luma theme)

Magento2.2.5 ass custom head.phtml to child theme

I am developing a custom “child” theme based off Luma and wondering how I might add a custom head.phtml file in my child theme so that I can have my magento load that to get the additional css and js i need loaded when my child theme loads.

I have edited the file located at app/design/frontend/Kiss/luma_kiss/Magento_Theme/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>     <referenceContainer name="head.additional">         <block class="Kiss/Headblock" name="porto_custom_head" template="html/head.phtml" before="-"/>     </referenceContainer>     <referenceBlock name="logo">        <arguments>           <argument name="logo_file" xsi:type="string">images/kiss_logo.png</argument>           <argument name="logo_img_width" xsi:type="number">200</argument>           <argument name="logo_img_height" xsi:type="number">200</argument>        </arguments>     </referenceBlock>   </body>