Wordpress custom template CSS - css

How can I apply CSS for a custom template in wordpress? In the theme I'm using, the background's suppose to be light-green, but when I create a template on PHP the background color is gone. And for example, if I assign a page the default template, the color is back. How can I add a CSS file so my custom template can have the same color or another color in case I want it to be different? Thanks in advance and sorry if my english is kinda sloppy.

Make sure your template imports your header which usually imports the style.css file of your theme.
Also you can make use of the admin style editor found under appearance on Wordpress admin menu to write custom css rules for your template.

Related

How to change the colour theme in wordpress site already existing

I am trying out wordpress, never did anything with it. I have to change the colors of an already existing website. When I select a different theme and press "apply", it doesn't work. The colors and the theme does not change.
Someone can tell me how to do it? Thank you.
The colors of the website does not depend on the theme which is installed.
You can change the colors by adding css and selecting global tags such as body or whatever. You could use the Custom CSS & JS plugin to do that.

Change the language in the template and change the template style in wordpress

i how with code can in template wordpress button change the language How can i do؟ that with change language,change template style
help me Thanks
Check out this link if you want to change the language
http://www.inmotionhosting.com/support/edu/wordpress/wordpress-features/change-language
and for CSS styling go to Dashboard-> Appearance-> customize you get a separate tab for changing CSS if you want to customize valid theme from WordPress repository.

Change the theme of one page without changing menu, search bar... in WordPress

Is there any way to use a theme only for the contents of one page?
I have already tried Multiple Themes plugin but it changes the appeareance of the whole html document (menu, search bar,... also)
Yes, you can.
1.Change the Content Structure.
To change the content structure, you need to create a custom page template.
You can follow this article to know more about how to add a custom page template to your theme and assign it to your page.
http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/
2.Only Change the Style
If the theme do it right, there should be a specific css class for the page on the HTML body tag. For example, page-id-1234. So all you need is add the css with the class for the page.
.page-id-1234 #entry-content {
//some css for the page
}

DRUPAL, Views: I cannot change theme from Views settings

I cannot change the css theme of my Drupal View. This is a screenshots of the settings:
http://dl.dropbox.com/u/72686/viewTheme.png
I've tried all buttons, I cannot save the new theme (BlueMarine) in the preferences. It is stuck on Zen (which is my front-end theme).
thanks
That dropdown in the image you link to is only showing you what the appropriate template files are in each theme. If you want advanced theming you could use something like http://drupal.org/project/themekey, or customise an existing theme.
What you see there is not a setting to change the theme of the view, but a tool to see what template files views can find and will use. You can use it to figure out what to name your template files you want to use for overrides. Views let you select which theme you want to see what template files will be used. The label also explains what it is used for very well: Theming infomation. It also states that
This section lists all the possible templates...

What is the difference between a theme and a template?

I am trying to migrate my site to Drupal and I am confused about themes and templates. The look and feel of the pages in my current site are completely controlled by template files and CSS. How does it work in Drupal?
In drupal, a theme handles the appearance of the site and a template handles how your content is rendered.
Think of it like this: the template is used to render the content, then the theme is applied on that content.
Edit: So, your css files live with the theme in drupal, and have nothing to do with the templates.
In Drupal, a "theme" is just a special type of plugin that bundles together any number of templates (to control how a given piece of data gets rendered to HTML), CSS, JS files, images, and so on.
So, there is a single "template" for your oveevral page markup, a single "template" for how a sidebar block is rendered as HTML, and so on. All of them, bundled together and named, are referred to as a theme.
Look at it this way: It's possible to create a theme that has no templates. Such a theme would have CSS files that override drupal's default CSS files. Using such a theme would create a website that looks almost exactly like Drupal's default site, except it would have different colors, fonts and so on.
But if you want to change the positions of items on the page, what kinds of items are on the page and so on, you have to override the default templates by adding some of your own to your theme. These new templates let you alter what information Drupal displays and what kind of HTML Drupal will use to display it.
For example, say I want to clone StackOverflow, but I want to do it with Drupal. First thing I would do is create a new content type (call it a "question") that is just like a story but has extra fields to track voting and so on. Drupal's default templates won't know about these extra fields, so they won't display them.
So, what I do is I go into my theme and I add a new node.tpl.php file. This new template is just like the standard one, except I can add code that says "if this node is of type 'question', insert the voting gadget to the left of the body."
Does this help?
A theme is made up of a collection of template files. block.tpl.php, node.tpl.php, page.tpl.php are all template files which when combined with your CSS, JS and images produces a theme. In addition a themes can be inherited. A theme can be created with just CSS and no additional template files by inheriting from an existing theme, in which case the template files from the parent theme are used.
Another way to look at it is a theme is what you see and the template files are responsible for generating the markup.
I hope this makes it a little bit clearer.
I'm confused...
The first answer says that templates and themes have nothing to do with each other, while the second one says themes are just collections of answers.
Which one is right?
Drupal is having a template based theming system. You can define your own regions in page and can arrange the content according to that . There are some default template file such as page.tpl ,block.tpl ,node.tpl which are displaying different kind of contents .
You can write your own template file as needed for eg if you need to alter the display of user registration form or login page you can create a tpl file for that and have to redirect the data to that tpl file. You can add the css or js to these templates using drupals apis. This redirection has to be done in the themes template.php file
A theme is comprised of css, js, images, and template files. Each theme may include multiple template files.
Additionally, themes can be inherited, and a subtheme's template files could override the template files of its parent theme.

Resources