Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #772925

    We’re using a third party solution to dynamically insert content into our website. This solution requires referencing a Div ID in a particular location on our homepage.

    The div class is: <div class=”ls-wp-fullwidth-container” style=”height:470px;”>

    I need to assign a div ID to this. Is there a way for me to accomplish this?

    #772995

    Hey ihf-eramstad,

    To add this new ID, follow these steps:

    1. Create a new js file in the js folder (for example: my_custom_script.js) and add this code:

    
    $(.ls-wp-fullwidth-container).attr('id', 'MyCustomID');
    

    2. Now, add this custom code at your function.php

    
    wp_register_script( 'my_custom_script',  $template_url.'/js/my_custom_script.js', 'jquery', "1", true);
    
    wp_enqueue_script( 'my_custom_script.js' );
    

    Best regards,
    John Torvik

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.