Forum Replies Created

Viewing 8 replies - 31 through 38 (of 38 total)
  • Thread Starter Koesterandersen

    (@koesterandersen)

    Hi

    I cannot get it to work properly. I have tried to put in the above code in different ways – with and without jQuery.

    I might have made an error with my functions.php file, which content the below code:

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ );
    function enqueue_parent_theme_style() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    wp_enqueue_script(“MyMenu”,”get_template_directory_uri()” . “/menu.js”);
    }

    I am trying to get it work on this website: https://www.tiptoptilbud.dk/

    I am just testing. If you try to click on TESTING 22 and GALLERI in the menu, you will see, that nothing happens.

    Thread Starter Koesterandersen

    (@koesterandersen)

    Hi

    I have already a functions.php file in my child theme, where I have managed to enqueue the css with the following code:

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ );
    function enqueue_parent_theme_style() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }

    Now – what I want, is some similar code. Though it should regard the menu.js file. I simply do not know what to write.

    (I have found the code above somewhere at the net and copied into my functions.php – and now I just want to copy and paste some other code, that will enqueue the menu.js file)

    Thanks

    Thread Starter Koesterandersen

    (@koesterandersen)

    Thank you mrtom414.

    That gave me an answer of my question, but it also created a new question.

    In what way do enqueue the menu.js file. In other words; what do I write in the functions.php file.

    Hi weblizar_support

    I am about to do the same thing as described above. I have found the menu.js file and pasted the code into it.

    Now I have this question.
    Shall I just overwrite the menu.js file in the parent theme or should I put the menu.js file into a child theme.

    Thanks in beforehand

    Thread Starter Koesterandersen

    (@koesterandersen)

    Hi bdbrown

    Thank you for your answers.

    Now when I have messed up in different threads today I might have learned (by accident) how the rules are here in the forum. And with your explanation I can see now, how the forum works. I will try to remember to do it right in the future.

    And thank you for the answer about the difference of the two enqueue functions. Now I have peace in my mind when it comes to this function.

    Have a nice weekend

    And thanks

    Thread Starter Koesterandersen

    (@koesterandersen)

    Thank you for your link.

    Thread Starter Koesterandersen

    (@koesterandersen)

    Hi

    I think it was the answer I was looking for. Today I am going to practise instead of just reading. Then I will see, if I can make it happen the way I want.

    Thank you very much for your help so far.

    Thread Starter Koesterandersen

    (@koesterandersen)

    Hi Jitendra

    Thank you for your answer.

    I have found the place in the CSS, where the width of 474 px (not 472 as I wrote in first place) is set. If I just change this to 600 px, then all the pages will get that width, I guess. If I still want some pages to be 474 px and a new page template to be 600 px, how shall I then connect the information in the CSS with the new page template.

    And another thing. If I make changes in the parent CSS, what will then happen with the new settings, when the theme is updated.

    Thank you in beforehand…

Viewing 8 replies - 31 through 38 (of 38 total)