This topic has 10 replies, 3 voices, and was last updated 1 years, 7 months ago ago by Rose Tyler
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
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
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?
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
ok please help
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
Horizontal slider not working because the style sheet not working with elementor
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
My question is how can i use those external links to my page? Am i supposed to work only with the resources you providing?
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
Tagged: best selling, external stylesheet, solutions, themes, troubleshooting, woocommerce
You must be logged in to reply to this topic.Log in/Sign up