I am almost done with my theme system for my codeigniter.
Come across a issue with style sheets have error 403 local host.
It was working on my other one but my new version will not pick up
Each theme has its on style sheet folder and java script. Most people say its wrong to do it that way but. This way is much more better for theme system.
theme/default
theme/default/stylesheets/stylesheet.css
theme/default/javascript/common.js
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title><?php echo $this->config->item('title'); ?></title>
<base href="<?php echo base_url(); ?>">
<link rel="stylesheet" type="text/css" href="application/views/theme/default/stylesheets/stylesheet.css" media="screen">
</head>
theme/codeigniter
theme/codeigniter/stylesheets/stylesheet.css
theme/codeigniter/javascript/common.js
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title><?php echo $this->config->item('title'); ?></title>
<base href="<?php echo base_url(); ?>" >
<link rel="stylesheet" type="text/css" href="application/views/theme/codeigniter/stylesheets/stylesheet.css" media="screen" >
</head>
I think direct access inside the applications folder will be revoked by the Code Ignitor. Hence, i put all put all images,CSS and JS in a folder named assets in the CI ROOT FOLDER, along with applications, system & user_guide.
Now, Make a file named utility_helper.php in ROOT_FOLDER/application/helper and add the following code
<?php
function asset_url(){
return base_url().'assets/';
}
?>
then add utility to application/config/autoload.php at line 67
$autoload['helper'] = array('utility');
Now when ever you want to access the asset folder, you can call it as
<link rel="stylesheet" type="text/css" href="<?php echo asset_url();?>stylesheets/stylesheet.css" />
<link rel="stylesheet" type="text/css" media="all" href=<?php echo
base_url()."application/views/theme/codeigniter/stylesheets/stylesheet.css"?> />
Related
We have a huge issue on our website, bots don't seems to find access to our metatags and opengraph wheareas we have some on our website when we inspect our code.
We have no "no-follow" tags.
Our header on theoffline.fr :
<head><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="true"><link rel="stylesheet" data-href="https://fonts.googleapis.com/css2?family=Public+Sans:wght#400;500;600;700&display=swap"><script type="text/javascript" id="hs-script-loader" async="" defer="" src="//js-eu1.hs-scripts.com/25053800.js"></script><link href="/font/medium/made-mirage-medium.css" rel="stylesheet"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""><meta charset="utf-8"><meta name="viewport" content="width=device-width"><meta name="robots" content="index,follow"><meta name="googlebot" content="index,follow"><meta name="description" content="Réservez facilement un break ou weekend réussi en Europe grâce à nos destinations, vols et hôtels triés sur le volet."><meta property="og:title" content="On part en weekend ?"><meta property="og:description" content="The Offline permet de réserver simplement des breaks réussis"><meta property="og:image" content="https://res.cloudinary.com/thiago9li214/image/upload/w_600/v1637599694/metaimage_home.png"><meta property="og:image:alt" content="home cover"><meta name="next-head-count" content="9"><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"></script><script src="/_next/static/chunks/webpack-c1b484df1c4f738003fb.js" defer=""></script><script src="/_next/static/chunks/framework-c93ed74a065331c4bd75.js" defer=""></script><script src="/_next/static/chunks/main-c4f2541b93e4ae8b71f8.js" defer=""></script><script src="/_next/static/chunks/pages/_app-45bf83b2e82b8ad55168.js" defer=""></script><script src="/_next/static/chunks/2c796e83-5c2bd38f513cac1a72df.js" defer=""></script><script src="/_next/static/chunks/493-0bf2abc775dda38e9783.js" defer=""></script><script src="/_next/static/chunks/962-5e3c0ea702c4b2b26f61.js" defer=""></script><script src="/_next/static/chunks/294-7bbb51a7ddd830e6cbcd.js" defer=""></script><script src="/_next/static/chunks/419-6b0210b57b5a60af5115.js" defer=""></script><script src="/_next/static/chunks/pages/index-d8a59dfbac10e5b77106.js" defer=""></script><script src="/_next/static/ZM4D0O7c_ysUL_ZkSKtqG/_buildManifest.js" defer=""></script><script src="/_next/static/ZM4D0O7c_ysUL_ZkSKtqG/_ssgManifest.js" defer="">
What Facebook bot is finding (from the debugger):
<!DOCTYPE html>
<html lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link href="/font/medium/made-mirage-medium.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="true">
<link rel="stylesheet" data-href="https://fonts.googleapis.com/css2?family=Public+Sans:wght#400;500;600;700&display=swap">
<script type="text/javascript" id="hs-script-loader" async="" defer src="//js-eu1.hs-scripts.com/25053800.js"></script><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="next-head-count" content="2">
<script defer nomodule="" src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"></script><script src="/_next/static/chunks/webpack-c1b484df1c4f738003fb.js" defer></script><script src="/_next/static/chunks/framework-c93ed74a065331c4bd75.js" defer></script><script src="/_next/static/chunks/main-c4f2541b93e4ae8b71f8.js" defer></script><script src="/_next/static/chunks/pages/_app-45bf83b2e82b8ad55168.js" defer></script><script src="/_next/static/chunks/2c796e83-5c2bd38f513cac1a72df.js" defer></script><script src="/_next/static/chunks/493-0bf2abc775dda38e9783.js" defer></script><script src="/_next/static/chunks/962-5e3c0ea702c4b2b26f61.js" defer></script><script src="/_next/static/chunks/294-7bbb51a7ddd830e6cbcd.js" defer></script><script src="/_next/static/chunks/419-6b0210b57b5a60af5115.js" defer></script><script src="/_next/static/chunks/pages/index-d8a59dfbac10e5b77106.js" defer></script><script src="/_next/static/ZM4D0O7c_ysUL_ZkSKtqG/_buildManifest.js" defer></script><script src="/_next/static/ZM4D0O7c_ysUL_ZkSKtqG/_ssgManifest.js" defer></script><style data-
Any ideas of what the problem might be?
Did you try adding the following code to your robots.txt:
User-agent: facebookexternalhit
Disallow:
You would also have to check if you forbid some of the bots via your robots.txt
I'm new to flutter web and I was working on a project that works fine on android
The problem is when I deploy to firebase hosting and click the google sign in button.
The pop up shows and I am able to sign in but when it pops out my app doesn't receive the FirebaseAuth.User Object and it stays null even when I evalute firebase.auth().currentUser expression in the console in browser
My index.html file:
<html>
<head>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<meta name="google-signin-client_id" content="<my client id>.apps.googleusercontent.com">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="ChurchData">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>App</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="/__/firebase/7.24.0/firebase-app.js"></script>
<script src="/__/firebase/7.24.0/firebase-analytics.js"></script>
<script src="/__/firebase/7.24.0/firebase-auth.js"></script>
<script src="/__/firebase/7.24.0/firebase-firestore.js"></script>
<script src="/__/firebase/7.24.0/firebase-functions.js"></script>
<script src="/__/firebase/7.24.0/firebase-messaging.js"></script>
<script src="/__/firebase/7.24.0/firebase-storage.js"></script>
<script src="/__/firebase/7.24.0/firebase-database.js"></script>
<script src="/__/firebase/7.24.0/firebase-remote-config.js"></script>
<!-- Load the Firebase SDKs before loading this file -->
<script src="/__/firebase/init.js"></script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
Screeenshot from Chrome
Screenshot from Firefox
I am using Next js for for my website and added Head section on every page for SEO
Here's my code for All Blogs page. I have imported withRouter so that I can use router in Head section
const head = () => {
<Head>
<title>Mental health blogs | {APP_NAME}</title>
<meta
name="description"
content="Mental Health blogs and tutorials on how to live mental-illness free"
/>
<link rel="canonical" href={`${DOMAIN}${router.pathname}`} />
<meta
property="og:title"
content={`Latest mental health blogs | ${APP_NAME}`}
/>
<meta
property="og:description"
content="Mental Health blogs and tutorials on how to live mental-illness free"
/>
<meta property="og:type" content="website" />
<meta property="og:url" content={`${DOMAIN}${router.pathname}`} />
<meta property="og:site_name" content={`${APP_NAME}`} />
<meta property="og:image" content={`${APP_NAME}`} />
<meta property="og:image:secure_url" content={`${APP_NAME}`} />
<meta property="og:image:type" content={`${APP_NAME}`} />
<meta property="fb:app_id" content={`${FB_APP_ID}`} />
</Head>;
};
My All Blogs page is Server Side rendered. When viewing my source code of this page, I can't see my meta title, meta desc etc. Any idea what is going wrong here. Thanks in advance!
why CSS is not loading when using segment URI in codeigniter
but it is working good when I remove the segment ?
this is how I link the css file
<title>TITLE</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- bootstrap -->
<link href="public/css/bootstrap.css" rel='stylesheet' type='text/css' media="all" />
<!-- //bootstrap -->
<!-- Custom Theme files -->
<link href="public/css/style.css" rel='stylesheet' type='text/css' media="all" />
<script src="public/js/jquery-1.8.3.min.js"></script>
Controller
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class profiles extends CI_Controller
{
public function index()
{
$user_id = $this->uri->segment(2, 9);
$this->load->model('user_model');
$this->load->model('count_model');
$data = array();
$result = $this->user_model->read_user_information_profile($user_id);
$data = array(
'username' => $result[0]->username,
'fname' => $result[0]->fname,
'lname' => $result[0]->lname,
);
$this->load->view('profiles_view', $data);
}
}
Thanks in advance
Because you are using relative URLs for loading your CSS, it's trying to load it from /dir/profiles/public/css/style.css instead of /dir/public/css/style.css hence why it doesn't load.
You can either use absolute URLs in your CSS with:
<link href="<?php echo base_url('public/css/style.css'); ?>" rel='stylesheet' type='text/css' media="all" />
Or set a base tag before you try to load any CSS or JS:
<base href="<?php echo base_url(); ?>" />
See: http://www.codeigniter.com/user_guide/helpers/url_helper.html#base_url, note you may need to load the URL helper if you're not already.
Change the loading in this way:
<!-- bootstrap -->
<link href="<?php echo base_url(); ?>css/bootstrap.css" rel='stylesheet' type='text/css' media="all" />
<!-- //bootstrap -->
<!-- Custom Theme files -->
<link href="<?php echo base_ur;(); ?>css/style.css" rel='stylesheet' type='text/css' media="all" />
<script src="<?php echo base_url(); ?>js/jquery-1.8.3.min.js"></script>
You don't need to config the base_url. It detect automatically
I have a wordpress site I am using ie conditional comments to load in an ie specific stylesheet in to. For some reason the changes made aren't being reflected in IE's rendering:
I have tried:
clearing browser history
deleting and re-uploading the file
ensuring the conditional comment is correct
closing all browsers and restarting
checking the file path
Adding php style now() to force refresh
And I've reached a point where I'm baffled.
What else can I try?
edit:
the code:
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>K9 Heaven - 21st Century Dog Care</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="http://www.k9heaven.org.uk/wp-content/themes/k9_0.2/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" media="all" href="ie.css" />
<![endif]-->
<link rel="pingback" href="http://www.k9heaven.org.uk/xmlrpc.php" />
<!--[if lt IE 9]>
<script src="http://www.k9heaven.org.uk/wp-content/themes/k9_0.2/js/html5.js" type="text/javascript"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="K9 Heaven » Feed" href="http://www.k9heaven.org.uk/?feed=rss2" />
<link rel="alternate" type="application/rss+xml" title="K9 Heaven » Comments Feed" href="http://www.k9heaven.org.uk/?feed=comments-rss2" />
<link rel="alternate" type="application/rss+xml" title="K9 Heaven » Home Comments Feed" href="http://www.k9heaven.org.uk/?feed=rss2&page_id=49" />
<link rel='stylesheet' id='NextGEN-css' href='http://www.k9heaven.org.uk/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0' type='text/css' media='screen' />
<link rel='stylesheet' id='shutter-css' href='http://www.k9heaven.org.uk/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.css?ver=1.3.2' type='text/css' media='screen' />
<script type='text/javascript' src='http://www.k9heaven.org.uk/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var shutterSettings = {
msgLoading: "L O A D I N G",
msgClose: "Click to Close",
imageCount: "1"
};
/* ]]> */
</script>
<script type='text/javascript' src='http://www.k9heaven.org.uk/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.js?ver=1.3.2'></script>
<script type='text/javascript' src='http://www.k9heaven.org.uk/wp-includes/js/jquery/jquery.js?ver=1.6.1'></script>
<script type='text/javascript' src='http://www.k9heaven.org.uk/wp-content/plugins/nextgen-gallery/js/jquery.cycle.all.min.js?ver=2.88'></script>
<script type='text/javascript' src='http://www.k9heaven.org.uk/wp-content/plugins/nextgen-gallery/js/ngg.slideshow.min.js?ver=1.05'></script>
<script type='text/javascript' src='http://www.k9heaven.org.uk/wp-includes/js/comment-reply.js?ver=20090102'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.k9heaven.org.uk/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.k9heaven.org.uk/wp-includes/wlwmanifest.xml" />
<link rel='index' title='K9 Heaven' href='http://www.k9heaven.org.uk' />
<link rel='prev' title='Contact' href='http://www.k9heaven.org.uk/?page_id=25' />
<meta name="generator" content="WordPress 3.2.1" />
<!-- All in One SEO Pack 1.6.13.3 by Michael Torbert of Semper Fi Web Design[395,435] -->
<meta name="description" content="K9 Heaven - 21st Century Dog Care" />
<meta name="keywords" content="K9,Heaven,21st,Century,Dog,Care" />
<link rel="canonical" href="http://www.k9heaven.org.uk/" />
<!-- /all in one seo pack -->
<meta name='NextGEN' content='1.8.3' />
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
</head>
http://www.k9heaven.org.uk/
Feel free to close this thread, forgot that relative css paths in wordpress themes go to the site root, not the theme root. And won the stupid hat.
Is this
http://www.k9heaven.org.uk/ie.css
the sheet you're tyring to load? or is it this:
http://www.k9heaven.org.uk/wp-content/themes/k9_0.2/ie.css
The code above is referencing the first style sheet at the root of the site. That's non-standard. You should use <?php get_theme_root() ?> in the style sheet link in the theme files to target the style sheet in the theme folder.