I need help to modify this rel="canonical" below to automatically pick up the url of the page, I have SEF turned on and using Joomla .htacces
<link rel="canonical" href="http://www.yourwebsite.com<?php echo $_SERVER['PHP_SELF']; ?>" />
this statement gets me the site's main url.
thanks
Use: JURI::current()
In your code:
<link rel="canonical" href="<?php echo JURI::current(); ?>" />
Related
I've gone through all the template .php, .css, .xml files but I can't find the link to a google font that I don't need and want to stop from calling.
I'm sure it must be buried in the many, many files that Joomla combines to build the webpage.
Site is Joomla, latest version. Template is Favourite. Font I want to kill from loading is Google "Lato"
https://rcidaky.com
The fonts that are loaded depend on what is selected in the template settings.
The default font in the template settings is Lato:
It doesn't look like there is an option to disable loading a Google font in the template settings.
The code that loads the fonts is located in the template file at /templates/favourite/index.php at line 78:
<!-- GOOGLE FONT -->
<!-- navigation -->
<link href='//fonts.googleapis.com/css?family=<?php echo str_replace(' ', '+',$this->params->get('nav_google_font'));?>:<?php echo ($this->params->get('nav_google_font_weight')); ?><?php echo str_replace('normal', '',$this->params->get('nav_google_font_style'));?>' rel='stylesheet' type='text/css' />
<!-- titles -->
<link href='//fonts.googleapis.com/css?family=<?php echo str_replace(' ', '+',$this->params->get('titles_google_font'));?>:<?php echo ($this->params->get('titles_google_font_weight')); ?><?php echo str_replace('normal', '',$this->params->get('titles_google_font_style'));?>' rel='stylesheet' type='text/css' />
<!-- text logo -->
<link href='//fonts.googleapis.com/css?family=<?php echo str_replace(' ', '+',$this->params->get('text_logo_google_font'));?>:<?php echo ($this->params->get('text_logo_google_font_weight')); ?><?php echo str_replace('normal', '',$this->params->get('text_logo_google_font_style'));?>' rel='stylesheet' type='text/css' />
<!-- default -->
<link href="//fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css" />
I was able to find this code by downloading the template install file, expanding the ZIP file to a local folder and then searching the files for occurrences of "googleapis".
The only two files where this string occurs are the template index.php file and the templateDetails.xml file.
I'm pretty sure the above code is what you are looking for.
An alternative solution (which doesn't involve editing the code) might be to use a suitable plugin such as JMG Disable Google Font.
if(preg_match('/(?i)msie /',$_SERVER['HTTP_USER_AGENT'])){ ?>
<link href=" echo $this->getSkinUrl('css/custom-ie-specific-style.css') "
rel="stylesheet" type="text/css" />
I want to add this stylesheet only for IE browser. Also added file in skin/css folder
Any help would be appreciated.
Thanks in advance..'
Instead of writing directly in head.phtml you can add the CSS with IE condition using page.xml (app/design/frontend/default/YOUR_THEME/layout) as below :
<action method="addItem">
<type>skin_css</type>
<name>css/styles-ie.css</name>
<params/>
<if>lt IE 8</if>
</action>
Let me know if you need further explanations or help.
What is the difference of this two codes?
Are these codes really all the same?
<link rel="stylesheet" href="<?php echo base_url(); ?>css/bootstrap.css">
<link rel="stylesheet" href="<?php echo base_url("css/bootstrap.css"); ?>">
Yes, the do produce the same result, although I would argue the second line in your example is the best method because it gives you more control when if and when you move to an asset manager of some kind.
Run in latest version of CodeIgniter:
<link rel="stylesheet" href="https://your-domain.org/css/bootstrap.css">
<link rel="stylesheet" href="https://your-domain.org/css/bootstrap.css">
I have some trouble to access root dir files when using subdomains:
My css files located in css dir in the root.
If i use url "my-site.com/css/file.css" - everything okay
If i use url "en.my-site.com/css/file.css" - 404 error
How can i fix it? I don't want to hardcode path to all my css and js files.
Thanks
try this for for loading all images, styles, js
<link rel="stylesheet" href="<?php echo site_url('css/file.css'); ?>">
don't forgot to create directory in your main CI folder.
if you not able to get that like this:
<link rel="stylesheet" href="<?php echo base_url(); ?>css/file.css">
you have a server problems and it is not Codeigniter related ;)
I am using the mageintern shop login magento extension. Simply i have installed it, enable it from admin, can see also in front-end, but where its css. Any suggestion ??
Any help would be appreciative. Kindly guide me please.
Thanks
JS
Its works ! I have change 33 line number in shoplogin_page.phtml
<link rel="stylesheet" type="text/css" href="<?php echo($this->getSkinUrl('css/shoplogin.css')) ?>" media="all" />
it works for me
same changes
<link rel="stylesheet" type="text/css" href="<?php
echo($this->getSkinUrl('css/shoplogin.css')) ?>" media="all" />