External Stylesheet not working as expected

This topic has 10 replies, 3 voices, and was last updated 1 years, 7 months ago ago by Rose Tyler

  • Avatar: invis
    invis
    Participant
    May 12, 2023 at 07:00

    How can i use externel style sheet on a particular page? its not working while i insert the link in header
    Also tried the wp_enqueue_style in function.php (not working)

    please help

    9 Answers
    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    May 12, 2023 at 09:28

    Hello, @invis,

    To use an external style sheet on a particular page, you can add the link to the external stylesheet in the <head> section of your HTML code, within the <head> tags.

    Here’s an example of how to add a link to an external stylesheet in HTML:

    <!DOCTYPE html>
    <html>
      <head>
        <title>My Web Page</title>
        <link rel="stylesheet" type="text/css" href="mystyle.css">
      </head>
      <body>
        <!-- Your HTML content here -->
      </body>
    </html>

    Make sure that the href attribute in the link tag is pointing to the correct path of your external stylesheet.

    If the above method is not working for you, you can try using wp_enqueue_style() function in your theme’s functions.php file.

    Here’s an example of how to enqueue a stylesheet in WordPress using wp_enqueue_style():

    function my_styles() {
      if (is_page('your-page-slug')) { // replace with your page's slug
        wp_enqueue_style('my-style', get_template_directory_uri() . '/mystyle.css');
      }
    }
    add_action('wp_enqueue_scripts', 'my_styles');

    In the above example, the is_page() function

    Best Regards,
    8Theme’s Team

    Avatar: invis
    invis
    Participant
    May 12, 2023 at 09:59

    i tried all the way.How can i check if the external css is compatible with your theme or not?

    Can you please help me for that?

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 12, 2023 at 15:34

    Hello Invis,

    Could you provide FTP access? We will create an example for you.
    To create FTP access, please contact your hosting provider for assistance.

    Kind Regards,
    8theme team

    Avatar: invis
    invis
    Participant
    May 12, 2023 at 19:25

    ok please help

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 13, 2023 at 15:27

    Hello Invis,

    Thank you for your reply with wp-admin access, but we need FTP access: FTP host, FTP username, FTP password, FTP port, FTP encryption.

    To create FTP access, please contact your hosting provider for assistance.

    Kind Regards,
    8theme team

    Avatar: invis
    invis
    Participant
    May 15, 2023 at 02:50

    Horizontal slider not working because the style sheet not working with elementor

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 15, 2023 at 08:49

    Hello Invis,

    Thank you for your response.

    We can see your custom styles are connected details on the screenshots provided:
    https://prnt.sc/AUtM0031XVnH
    https://prnt.sc/pMZsh3wi9-rw
    We cannot guarantee the work of third-party forces, neither with our own nor with Elementor.

    Best Regards,
    8Theme’s Team

    Avatar: invis
    invis
    Participant
    May 15, 2023 at 09:06

    My question is how can i use those external links to my page? Am i supposed to work only with the resources you providing?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 15, 2023 at 09:46

    Hello Invis,

    Thank you for your response.

    In order to apply styles exclusively to My-account page, you need to add the following code to wp-content\themes\xstore-child\functions.php:

    function my_child_styles() {
      if (is_page('my-account') || is_page('my-account-2')) {
    
        wp_enqueue_style('child-bootswatch-bootstrap-style', 'https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.6.0/flatly/bootstrap.min.css');
        wp_enqueue_style('child-jquerysctipttop-style', 'https://www.jqueryscript.net/css/jquerysctipttop.css');
      }
    }
    add_action('wp_enqueue_scripts', 'my_child_styles', 101);

    Unfortunately, FTP access you provided is no longer valid. Have you changed them?
    You may use any third-party resources, however, we are not responsible for their performance.
    We hope it is clear now.

    Best Regards,
    8Theme’s Team

  • Viewing 10 results - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.