load style css in codeigniter framework [duplicate] - php

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
CodeIgniter - Loading CSS
I try load css file and it's not work.
this is the link tag:
<link rel="stylesheet" type="text/css" href="application/styles/style.css" />
how i can do this?

Make a folder outside the application folder Eg: resources/css/style.css and link it like below.
Then the folder structure will be like this,
-application
-resources
-system
-index.php
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>resources/css/styles/style.css" />

Related

Wordpress does not detect bootstrap and Jquery [duplicate]

This question already has answers here:
WordPress: Loading multiple scripts with enqueue
(3 answers)
Closed 12 months ago.
I have an application that I'm trying to include in a wordpress page, I passed it the include of the index.php file and everything is displayed but when it looks for the JQuery and Bootstrap files for the style these are not detected.
The style files are located in the same folder as the index file and I pass them as follows (they are just examples):
<link rel="stylesheet" href="include/bootstrap4/css/bootstrap-select.min.css">
<link rel="stylesheet" href="include/bootstrap4/css/bootstrap.min.css">
<link rel="stylesheet" href="include/bootstrap4/other/jquery-ui.css">
<script src="include/bootstrap4/other/jquery-3.3.1.min.js"></script>
Also I tried to include Bootstrap with cnd and the style is detected but with Jqueys still nothing.
The application without the jquery files does not work, can anyone tell me how I can include bootstrap and Jquery in the page?
If you want to add files just enough, use the parameter get_template_directory_uri():
<link rel="stylesheet" href="<?php echo get_template_directory_uri() . '/your/path/and/file.css' ?>">
But don't do that.
Better to use CDN with these libraries as it has very good compression and file caching support.
Take a look here getbootstrap

How use absolute link in href header

I work on my website but I have a problem with the links in the href.
My CSS and javascript files are in this folder (in the root of my site):
assets/stylesheets/file_css.css
For now the links of my href looks like this:
<link rel="stylesheet" href="./assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="./assets/stylesheets/custom.css">
<link rel="stylesheet" href="./assets/stylesheets/media-queries.css">
I call it in all my php files with :
require_once __DIR__.'/layouts/header.php'
Problem:
When I want to create a folder to sort my files eg views (folder found at the root of my site)
Looks like views/test.php
All href don't work, console error :
test.php:10 GET http://localhost/mywebsite/views/assets/bootstrap/css/bootstrap.min.css
test.php:11 GET http://localhost/mywebsite/views/assets/fonts/font-awesome/css/font-awesome.min.css
test.php:12 GET http://localhost/mywebsite/views/assets/stylesheets/custom.css
In fact, my CSS aren't in views folder.
I tried many things
1 - <link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css">
error => test.php:10 GET http://localhost/assets/bootstrap/css/bootstrap.min.css
2 - <link rel="stylesheet" href="<?php echo __DIR__ ?>/assets/bootstrap/css/bootstrap.min.css">
error => test.php:10 Not allowed to load local resource: file:///C:/wamp/www/mywebsite/layouts/assets/bootstrap/css/bootstrap.min.css
I thought to put href="/mywebsite/assets/bootstrap/css/bootstrap.min.css" in the first link, it works locally but not on the server
I really need help, I start having too much PHP file at the root
Thank you

Wordpress Theme + SSL doesn't work [duplicate]

This question already has answers here:
CSS doesn't work on HTTPS pages in Chrome and IE
(2 answers)
Closed 7 years ago.
My personal blog works when you connect via http but not with https. When you use https it doesn't load the CSS code. Any ideas? The certification is via Let's Encrypt program.
My site:
http://nicktehpro.xyz/
Broken Link:
https://nicktehpro.xyz/
At each place in the document where u have used:
href="http://nicktehpro.xyz/wp-content/themes/enigma/style.css"
Please change it to:
href="wp-content/themes/enigma/style.css"
or use a protocol relative uri:
href="//nicktehpro.xyz/wp-content/themes/enigma/style.css"
because your references are non-secure links they are avoided when using a secure connection
It looks as though there is an error accessing the stylesheets, images, and other objects you are linking to on the page. When you go to https://nicktehpro.xyz, it is trying to load other links from http://nicktehpro.com Its not allowing you to load insecure data onto a secure page. Make sure that you are either loading all from http or https not a mixture of both. you can fix this by using relative links, starting with
href="/wp-content/link-to-file"
or
src="/wp-content/link-to-file"
instead of
href="http://nicktehpro.xyz/wp-content/link-to-file"
all the links should start with https which is not the case for your css and js files , example :
<link rel="stylesheet" href="http://nicktehpro.xyz/wp-content/themes/enigma/style.css" type="text/css" media="screen" />
should be
<link rel="stylesheet" href="https://nicktehpro.xyz/wp-content/themes/enigma/style.css" type="text/css" media="screen" />
and the other links too
I went ahead and downloaded the theme you're using to further help you, navigate to Header.php and replace on
line 18
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
with <link rel="stylesheet" href="/wp-content/themes/enigma/style.css/" type="text/css" media="screen" />.
EDIT:
After looking into it' there's also a plugin which can achieve this for you for anything that may not be working because it displays as http and not https you should consider giving it a try here.

How to refer to css file in codeigniter?

I use XAMPP and CI 2.14
(I know it's sounds ridiculous, but...) I don't know how to refer to a css file from a view. I've read and tried a lot of examples but, obviously I do something wrong...
<link rel="stylesheet" href="<?php echo base_url();?>css/main.css" type="text/css" />
The base url is: http://localhost/myapp/
Where should I put then main.css file (now is in the webroot/myapp/css folder), and how to reference it from a codeigniter view?
create folder assets:
path is: /assets/css/your_file.css
<link rel="stylesheet" href="/assets/css/your_file.css" type="text/css" />
Try to put the css folder inside the application folder, like this:
/yourapp/application/css/
And then
<link rel="stylesheet" href="<?php echo base_url();?>application/css/main.css" type="text/css" />

how can i can call css on a php file in Wordpress? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How To Include CSS and jQuery in my wordpress plugin?
I was going to add a button on a wordpress plugin
I want to add a style on button I know the basic way to call a css into a html file like.
<link rel="stylesheet" type="text/css" href="buttonPro.css">
but its not working on a php file
You can call it like this:
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>
/css/style.css" media="screen" />
When your style sheet is living in a subdirectory called 'css' and the actual file is called 'style.css'. Don't forget to escape the HTML code in php:
<?php
put some php code here
?>
**put some HTML code here**
<?php
now you can continue with php
?>

Categories