How to Use Custom CSS and JS in Prime Slider Pro

  • BdThemes
  • How to Use Custom CSS and JS in Prime Slider Pro

Table Of Contents

How to Use Custom CSS and JS in Prime Slider Pro

This documentation provides comprehensive insights into the using the Custom CSS and JS of Prime Slider Pro.

🧩 Custom CSS and JS

The Custom CSS and JS feature in Prime Slider Pro allows you to add your own styling and scripts directly from the plugin interface — no need to edit theme files or child themes. It gives you full creative control to customize the design and behavior of your post layouts, widgets, and elements exactly how you want.

✨ Key Features

  • Add Custom CSS:
    Write and apply your own CSS code to style any widget or section within Prime Slider Pro.
    Perfect for adjusting layouts, colors, fonts, and spacing.
  • Add Custom JavaScript:
    Insert JavaScript or jQuery snippets to add interactive effects or advanced functionality.
  • Widget-Level Customization:
    Apply code to a specific widget only — no need to affect the entire site.
  • Safe and Update-Proof:
    Your custom code is stored securely and won’t be lost during theme or plugin updates.
  • Post and Page Excludes:
    Exclude specific posts or pages from loading your custom CSS & JS so code only runs where you want it.

Find Custom CSS and JS features.

custom css and js

Navigate to your WordPress Dashboard.

  1. Go to Prime Slider Pro > Extra Options.
  2. Then click on the Custom CSS & JS tab. Here, you’ll find the custom code section where you can easily add and manage your own Custom CSS and JavaScript for advanced styling and functionality.

Header Code Injection

In this section, you’ll find a code injection header area where you can input your custom CSS or JavaScript code. This allows you to apply unique styles or scripts directly to your site without editing theme or plugin files.

Header injection - BdThemes
  1. Header Code Injection: Code entered here will be added to the <head> section of your website.
  2. CSS: Write your custom CSS directly — no need to include <style> tags.
  3. JS: Add your custom JavaScript without using <script> tags.

Footer Section Injection

In this section, you’ll find a code injection footer area where users can add their custom CSS or JavaScript code. The code entered here will be injected into the footer section of the website, allowing scripts or styles to load after the main content for better performance.

Footer injection - BdThemes
  1. Footer Code Injection: Code entered here will be added to the </body> section of your website.
  2. CSS: Write your custom CSS directly — do not include <style> tags.
  3. JS: Add your custom JavaScript directly — no need to use <script> tags.

Page & Post Exclusion Settings

Set the exclusion for a specific page or post. Simply select the page or post you want to exclude, and apply it to prevent the custom CSS or JS from loading on that specific content.

Exclude the Pages and Posts - BdThemes
  1. Page & Post Exclusion Settings: Select the specific pages and posts where you don’t want any custom code to be injected. This setting applies to all the sections mentioned above.
  2. Exclude Pages & Posts: Select the pages and post to exclude it.
  • Posts: Displays a list of all pages from your WordPress site, allowing you to choose which ones to exclude from the custom code injection.
  • Recent Posts: This section lists all your WordPress posts. You can select any post from here to exclude it from the custom code injection.

    Inject Custom CSS and JS for Header Section.

    We’ll now add some custom CSS code to see how it works.
    To begin, insert any widget into your page using the Elementor editor.

    Set the Custom CSS Code

    We will check how to find any css of the widget and use it for the Custom Code for this.

    Insert Any Widget

    Insert General slider - BdThemes
    1. Click on the “+” icon to add a new section.
    2. Then, search for the General widget.
    3. Drag the General widget and drop it into the section on your page.

    Inspect page and Find the CSS of the Widget

    Inspect 1 - BdThemes
    1. After inserting the widget on the page, right-click anywhere on the section and select “Inspect” from the browser menu. This will open the developer tools so you can view and test the section’s HTML and CSS.
    Inspect 2 1 - BdThemes
    1. Now, locate the widget you want to style and identify its CSS class.
      For example, if you select the Title in the General widget, its CSS class might be bdt-title-tag. You can use this class to apply your custom CSS.

    Set the Custom CSS and Check it

    We will test it by selecting the Custom CSS for the Post.

    Now Set the Custom CSS code according to the Class

    Inspect 3 - BdThemes
    1. Now, go to the CSS section in the Custom CSS & JS settings and write your custom code.
      For example, you can add a simple CSS snippet to style the Title like this:

    css:

    .bdt-title-tag {
    background-color:yellow;
    padding:10px;
    border-radius:10px;
    color:white;
    
    }

    This will make the title white, with a yellow background, Padding for inner space and Border Radius.

    Inspect 4 - BdThemes
    1. Now, click on “Save Custom Code”.
      After saving, you will see a confirmation message, for example: “Custom code saved successfully!”

    Check the custom find

    Inspect 5 - BdThemes
    1. Now, go to the preview page.
      You will see the custom CSS applied to the widget as defined — for example: yellow background, white text, Border Radius, and Padding a little bit.

    Now Check where the code injected ?

    Inspect 6 - BdThemes
    1. Now, right-click anywhere on the page and select “View Page Source”.
      This will open a new page showing the full HTML of your site, where you can see the custom CSS code injected into the <head> or <body> section, depending on where you added it.
    Inspect 7 - BdThemes
    1. After scrolling through the page source, you will find the Custom CSS section.
      It will display a comment indicating it’s custom code, followed by the CSS code you added. This confirms that your custom code has been successfully injected into the page.
    <!-- Prime Slider Pro Custom Header CSS -->
    <style type="text/css">
    .bdt-title-tag {
    background-color:red;
    padding:10px;
    border-radius:10px;
    color:white;
    }
    </style>
    1. The custom code injection appears just before the closing </head> tag in the page source, ensuring that your CSS is loaded in the header section of the website.

    Set the Custom JS Code

    We will check how to set the Custom JS code and use it.

    js insert - BdThemes
    1. Navigate to the Extra Options section.
    2. Now select the Tab of Custom CSS & JS
    3. On the JS section, write the Custom JS code.

    Here we have written the simple JS code for test purpose only.

    alert(" Hello, Prime Slider World ");
    js insert 1 - BdThemes
    1. Now click on the ” Save Custom Code ” button to save it. And this will appear a message “Custom code saved successfully! “.

    Check the JS preview.

    js insert 2 - BdThemes
    1. Now navigate to any page to see the JS Alert. Reload the page and the alert will appear. It means the custom JS is working perfectly.

    Check where the Custom JS Code Injected

    js insert 4 - BdThemes
    1. Now, navigate to any page and right-click on it to open the options menu. Then, select Inspect to inspect the page.
    js insert 5 - BdThemes
    1. Now, the custom JS will appear in the inspected section.
    2. The custom code is injected just before the closing </head> tag.

        Inject Custom CSS and JS for Footer Section.

        We’ll now add some custom CSS code for the footer section to see how it works.
        To begin, insert any widget into your page using the Elementor editor.

        Set the Custom CSS Code

        We will check how to find any css of the widget and use it for the Custom Code for this.

        Insert Any Widget

        Insert General slider 2 - BdThemes
        1. Click on the “+” icon to add a new section.
        2. Then, search for the General widget.
        3. Drag the General widget and drop it into the section on your page.

        Inspect page and Find the CSS of the Widget

        Inspect 1 1 1 - BdThemes
        1. After inserting the widget on the page, right-click anywhere on the section and select “Inspect” from the browser menu. This will open the developer tools so you can view and test the section’s HTML and CSS.
        Inspect 2 2 - BdThemes
        1. Now, locate the widget you want to style and identify its CSS class.
          For example, if you select the Title in the General Slider widget, its CSS class might be bdt-title-tag. You can use this class to apply your custom CSS.

        Set the Custom CSS and Check it

        We will test it by selecting the Custom CSS for the Post.

        Now select the Custom CSS code according to the Class

        css 1 - BdThemes
        1. Now, go to the CSS section in the Custom CSS & JS settings and write your custom code.
          For example, you can add a simple CSS snippet to style the Title like this:

        css:

        .bdt-title-tag {
          background-color:red;
          padding:10px;
          border-radius:10px;
          color:white;
        }

        This will make the title white, with a red background, and a larger font size.

        css 2 - BdThemes
        1. Now, click on “Save Custom Code”.
          After saving, you will see a confirmation message, for example: “Custom code saved successfully!”

        Check the custom find

        css 3 - BdThemes
        1. Now, go to the preview page.
          You will see the custom CSS applied to the widget as defined — for example: red background, white text, Border Radius and Padding a little bit.

        Now Check where the code injected ?

        css 4 - BdThemes
        1. Now, right-click anywhere on the page and select “View Page Source”.
          This will open a new page showing the full HTML of your site, where you can see the custom CSS code injected into the <head> or <body> section, depending on where you added it.
        css 5 1 - BdThemes
        1. After scrolling through the page source, you will find the Custom CSS section.
          It will display a comment indicating it’s custom code, followed by the CSS code you added. This confirms that your custom code has been successfully injected into the page.
        <!-- Prime Slider Custom Footer CSS -->
        <style type="text/css">
        .bdt-title-tag {
          background-color:red;
          padding:10px;
          border-radius:10px;
          color:white;
        }
        </style>
        1. The custom code injection appears just before the closing </body> tag in the page source, ensuring that your CSS is loaded in the header section of the website.

        Set the Custom JS Code

        We will check how to set the custom Js of the widget and use it for the Custom Code.

        js 1 1 - BdThemes
        1. Navigate to the Extra Options section.
        2. Now select the Tab of Custom CSS & JS
        3. On the JS section, write the Custom JS code.

        Here we have written the simple JS code for test purpose only.

        alert(" Hello, Prime Slider Pro! ");
        js 2 1 - BdThemes
        1. Now click on the ” Save Custom Code ” button to save it. And this will appear a message “ Custom code saved successfully! “.

        Check the JS preview.

        js 3 1 - BdThemes
        1. Now navigate to any page to see the JS Alert. Reload the page and the alert will appear. It means the custom JS is working perfectly.
          The JS Alert is ” Hello, Prime Slider Pro!

        Check where the Custom JS Code Injected

        js 4 1 - BdThemes
        1. Now navigate to any page and click on the Right button and it will appear the option section. Now click on the Inspect the page.
        js 5 - BdThemes
        1. Now the appear on the custom JS with the comments <!– Prime Slider custom Footer JS –>.
        2. The custom appear before the body closing tag.

        Pages and Post Exclusion

        Please select any page to exclude it. The Page will not allow the custom CSS or JS.

        Page Exclude - BdThemes
        1. Navigate to the Prime Slider > Extra Options section.
        2. Now select the ” Custom CSS & JS ” tab.
        3. Scroll down and find a section where have the Pages & Post Exclusion settings avaiable.

        Check Page Exclusion

        The changes will apply for the Page only. You can select any page to get rid of the custom code injected for header and footer.

        Choose Any Page for Exclusion

        Page 1 - BdThemes
        1. Now select any page that want to exclude. Here will demonstrate all the pages available on the dashboard.
        Page 1 savepng - BdThemes
        1. Now click on the “Save Custom Code ” button and it will save and a message will appear ” Custom Code Saves Successfully ( 1 pages excluded ) “.

        Select The Page and Check

        Page 2 - BdThemes
        1. Now navigate to the Pages > All Pages section where all the page available.
        2. Now select the Page that we have already selected. Click on the View. It will navigate to the View page.
        Page 4 - BdThemes
        1. The Navigation link appear that page we are visiting.
        2. Now check the Title of the General Slider. The widget we have selected for the demonstration. It’s appear just simple page not Custom CSS code applied here.

        Inspect and check the Code

        Page 5 - BdThemes
        1. Now Right click on the page and it will appear all the options. Now select the Inspect options and click on it.
        Page 6 - BdThemes
        1. Now check the page and on the Heading section. No Prime Slider Custom CSS Code appear before </head> closing tag.

        Check the Post Exclusion

        The custom will not apply for the post that will be selected.

        First check the Post.

        post 1 - BdThemes
        1. Navigate to the Posts > All Posts section. It will appear all the posts.
        2. Now choose any post that want to check the preview. We have selected one and click on the ” View ” page.
        post 2 - BdThemes
        1. It will navigate to the new page and the The Post URL will appear on there.
        2. The Alert function will appear on there and it will show the alert message.

        Now Select the Post for Excluding

        post 3 - BdThemes
        1. Now navigate to the Prime Slider > Extra Options section.
        2. Now select the ” Custom CSS & JS ” tab.
        3. On the Recents Posts section select any post for excluding. You can select one or more posts at a time. e.g.: We have selected the first post.
        post 4 - BdThemes
        1. Now click on the ” Save Custom Code ” button to save it. It will appear a message “Custom Code Saved Successfully ( 1 pages excluded) “.

        Now check it on the preview page

        post 1 1 - BdThemes
        1. Navigate to the Posts > All Posts section. It will appear all the posts.
        2. Now choose any post that want to check the preview. We have selected one and click on the ” View “ button of the page.
        post 5 1 - BdThemes
        1. It will navigate to the Post Page. The Post Link appear on there.
        2. On the Body section the post info appear only. The Alert is not appearing on there.

        Now Inspect and Check it

        post 6 - BdThemes
        1. Now Right click on the mouse to open the options and select the inspect. If you can like you can use the shortcut. Press Shift + Cmd + I.
        post 7 - BdThemes
        1. Now check before the </head> tag it will appear no longer the content.

        By following this instruction you can use the Custom CSS and use it on your own way.

        Video Assistant

        Video Tutorial Coming soon!

        Thanks for staying with us.

        Take advantage of fine-tuned plugins

        Get Customizable Elementor Widgets to Power Up Your Website

        Take advantage of fine-tuned plugins to speed up web projects without sacrificing quality. We offer a 60-days money-back guarantee.

        Call or WhatsApp for assistance:+880 1700 55 95 95

        Our supported payment system and security badge