Add Link to CSS StyleSheet - css

where can i add a link to a custom css file in Joomla?
I have tried adding file in index.php but it is valid only for that template and if i load another template i lose the link.
I'm using Joomla 2.5.

The right place for a site-wide css should be the template index.php file. But since you plan to use several templates, the only other meaningful option is to add it in a system plugin event, instead of spelling out the code you will need to use
$document->addStyleSheet($cssurl)
However it will be more effective if you just insert it into all your templates. Also please note that system page cache may not run the events on cache hits.

Related

Copy the contents of existing page to another page with different name in wordpress without using any plugin

I am new in WordPress. In my WordPress application having one page named "Retail". I want to create new page named "Website" with the same content of "Retail" page. I copied content and paste in to new page editor and saved. But some CSS problem is there. I think css file is missing kind. How to resolve this problem?
We cannot find the problem without any real information. However you can check if any of the following issues occurs:
You use a theme which let you add custom CSS rules in specific page. You might have a settings button in the page where you add it. In that case, you need to copy that as well.
You need to check your CSS files and see if the styling rules are applied for a specific page. It could be like .page-id-662 or .pageid-662
The last you could check is the functions.php file in case you enqueue a styling CSS file on specific pages as well.
What did you do exactly?
Created a new page in the Wordpress backend and copied the contents of "Retail?
Or put on a whole new Wordpress website and copy the "Retail" page there?
And please give an example of what went wrong in the design. Can you possibly specify the HTML code of an element with a design error?

Wordpress page template option not displaying in dashboard?

I'm using wordpress 4.9.6 version it's not showing page template option. I reinstalled wordpress and using default themes and plugins. I don't know the exact reason for this. Please help me out of this. Tell me the reason why it occurs.
Your theme must have template file. The default WordPress themes does not have that by default.
You need to create a new .php file, name it whatever and add this following code in the top:
<?php
/**
* Template Name: your template name
*
*/
One of the easiest way to create a Template, is as follows:
Creating the Template file:
Open up your preferred Text Editor. I would recommend Notepad++ for its 'best of both worlds' feel. It offers a greater range of tools than 'Notepad' whilst not being too overwhelming.
Next, you will need to enter the following code:
<?php
// Template Name: Name of Template.
?>
Then head to File > Save as ... and enter your desired file name. Then within the 'Save as type' dropdown menu, select 'PHP Hypertext Preprocessor file'. This file type will be appended with a series of file extensions, within a set of brackets.
Go ahead and select 'Save'.
Of course, don't forget to enter your relevant Template coding and save as you go along.
Upload to website:
With your Template file completed, you will now be ready to upload this to your website. One of the easiest way to do this, is as follows:
Download FileZilla. If you are unsure of which version to download, stick with 'Download FileZilla Client'.
Once downloaded and installed, open the program. Then login, with your site's credentials. If you are unsure of these, you will need to seek assistance from your hosting provider.
By now, you should see a screen like:
The above image has a lot of blank spaces. If you are logged in, these blank spaces will be populated with various folder and file names etc. Referring to the above image, take take of the contents within the red box. This text bar may be populated. Just enter '/httpdocs/wp-content/themes'. Alternatively, you can scroll through the Folders manually.
All you then need to do, is identify the relevant Theme and drag over the desired template file and drop it into the relevant theme's folder.
When it comes to WordPress themes, you may first want to familiarise yourself with Child Themes. Simply put, if you are not the Theme Author, you will need to create a Child Theme. If you modify the Parent theme, any file modifications will be lost. Whilst this wouldn't be the case, in this instance, you may wish to take this opportunity in understanding Child Themes and implementing said themes now, in preparation for future modifications.
The solution in my case was to add index.php file in theme's root folder.
It appears that adding my theme into Git repository (with Git Desktop) and selecting default .gitignore file of Wordpress incorrectly ignores the index.php file inside theme's root folder, so the file was never uploaded to the server after deploy and WordPress does not recognize the theme as valid one - hence the missing drop-down with template selection.

Ignore or overwrite templating in Drupal 7?

I'm new to Drupal. I have a page template that has a nav, header and footer. This works correctly for how I want most of my site, except for the login page that I would like to completely customize.
Is there a way to overwrite or ignore the overall site templating (perhaps by placing my login page template into a folder within the /templates directory?) in order to style that one page differently?
Thanks.
If you are looking out for customizing only the login page without its effect on anywhere in the site, you can use page--user--login.tpl.php to override it.
Basically you should find system template you want to override. It may be part of standard drupal installation but also part of some module. Copy it to your theme's templates directory and change the way you like. Clear the cache and drupal will re-scan your theme and start using templates you added instead of original one.

wordpress adding php files and linking to them

i'm wondering if it's possible to add a php file in your themes folder (wp-content/themes/classic) where the css file is, then link afterwards? Because i'm currently trying to add a register.php into my blog but i still need the header and everything else.
Yes. For example, if you want something like www.yourdomain.com/test follow this steps:
In your theme folder create a php file called page-test.php.
From your dashboard publish a page with the title Test(with no content at all).
Now, when you'll go to www.yourdomain.com/test you will se your page. And in page-test.php you can use all Wordpress functions such as get_header(), get_sidebar() etc.
Yes. What you want is to define a new "page" template, and then to create a new page in your wordpress using that template. Here's the WP documentation on that topic: http://codex.wordpress.org/Pages#Page_Templates
Alternatively, you don't have to place it in your theme folder; you can put it in the root wordpress folder and have it function outside of wordpress. Then you can change your theme to have a static link to that page, or link to it in some other manner. It would be more difficult to use the header/footer/sidebar template features, though.

Drupal: modifying a template without hacking the module

I need to edit an invoice template in Drupal (both php template and css).
I've copied pasted the file in my theme folder, as I usually do to override for blocks and pages templates, but it didn't work.
This is the template customer.itpl.php inside Ubercart/uc_orders/templates folder.
How can I override it without hacking the ubercart module ?
thanks
This template is not the normal Drupal template. In order to change it, you should create a copy of the template in the same folder (Ubercart/uc_orders/templates) and make your changes. It will show up as an option in the settings page (/admin/store/settings/orders/edit) where you specify which template to use for showing the invoice.
devel_themer is good at providing template suggestions for you. Sometimes modules uses a special naming convention.
If that doesn't help you can add your own template suggestion in a preprocess function for the template. See this post on d.o for more info.
According to the ubercart docs you should be able to specify which template files you want to use.

Resources