CSS not applying in my DRUPAL 7 site on localhost - css

I'm working with Drupal 7.2, till now i have worked on somebody's localhost,now i decided to work on my own PC, so i make a copy of original code form other's PC and paste it to my localhost WAMP and also upload database into my localhost/phpmyadmin, but some how its not working at all.
CSS not been applying to the site, its displaying all the content without CSS. can anyone help me for this issue?
I tried out by clearing a cache from admin side as well as from browser.
Thanks.

Not just the cache but the aggregating too make sure you clear all the check boxes
Cache pages for anonymous users
Cache blocks
Even those under bandwidth optimization
Aggregate and compress CSS files.
Aggregate JavaScript files.
Works like a charm. Thanks guys

Presumably you're seeing the Drupal site itself (implying your db/web server/php settings are ok) but just unthemed? Have you tried clearing the Drupal caches? As you lifted the database from another host it's possible you might need to do this to force drupal to rebuild it's menu paths.

You should check the source code of the site on your localhost and check that the file paths to the css style sheets is correct. Using Google Chrome Developer Tool you can update the paths and see when they take affect or just keep updating your templates until you get it right. Also check that any options in the database are using your localhost and not the other domain

You may try following to debug:
Clear Drupal cache from admin/settings/performance.
Rebuild theme registry.
Add a new theme to your site and see if it is rendering the content properly.

I see the same problem, yet no solution suggested has resolved this... I notice in source code that it seems to truncate the css paths to be at site root i.e. < link type="text/css" rel="stylesheet" href="http://dev.drupalsite.com/installed_dir/ media="all" > ... hmm

Related

Styling not refreshing for old visitors on WordPress

I’m working on correcting a styling of an element on an WP-based eCommerce site.
The site has both SCSS and CSS files.
To make things quick, I edited the CSS via Appearance -> Customize -> Additional CSS.
However, when I was done and published my changes (and solved the issue), only those new to the website sees the difference.
Those who have visited the site prior to the deployment of the solution, still see the distorted number layout
I also suspected that the SCSS gets compiled every refresh but when I checked the File Manager (cPanel), only the CSS files get modified.
I’m feeling this might be a cache-related issue. I have already disabled a cache plugin (WP Rocket). However, the problem still persists.
What possible issue am I experiencing?
Edit: I did try to use Incognito and the change did reflect. However, the users of the site are non-techy people and don't know how to refresh.
The site is using GoDaddy as the host. Is it possible the issue is on that part?
Thank you

Drupal theme isn't responsive in different servers

I have a problem with a drupal theme. I edit an already existing theme css and installed it in my server. It's responsive regardless of the changes I made but when I install it in another server is no longer responsive.
Both server has Drupal 7.40 installed, yet I can't find why the theme isn't responsive in the other server
Thanks
No matter on what server you are running your site if servers are set well output should be identical. Meaning HMTML, CSS JS files, images should be the same. My suggestion would be to open same page on both servers, and compare what are they delivering to you. Start with page source i.e. Right click on page, "View page source", and save into file. Then use some tool to compare those 2 sources. Check for differences....
Then you can use Firebug or similar tool to check are all page resources (as mentioned, CSS, JS images...) loaded well.
If all is ok so far...then you have to compare resource files too. Start with CSS maybe...then go to JS.
It's tedious work...but without additional info that's the best advice I can give you.

Wordpress 3.5 upgrade to 4.0. Theme compatibility

I got in charge of some small sites that are running on WP 3.5; they are all using the same theme (a customized version of Bones). I have only used Joomla some years ago so I have no idea if, after the upgrade, the theme will still be compatible. I want to upgrade my WP version because the current one is vulnerable: I keep getting spam links into my articles that are placed inside hidden divs.
How can I know if the template is compatible or how can I fix the security issue. Any of these will do great.
Thanks!
WordPress does a very good job of changing very little with regards to theme tags in a core update. That said, we have no idea how your theme(s) have been made, or what functions they use.
The best, and probably only realistic option here, is to create a test site (a duplicate) and update that site first, then test to make sure all is working as it should.
As for the vulnerability, this is likely due to an insecure admin password or an insecure plugin. You should ensure all your plugins are up to date and that your admin panel is suitably secure.
When you update wordpress, it will not affect the wp-content folder which is having themes and plugins. So, don't worry update it. But for the secure updation, please take the backup of whole website first. Take backup of database and all files before doing any update.
WP 4 hasn't been out that long. I'd hold off on the upgrade unless you absolutely have to, until you know that all of the plugins used on the sites are compatible w/ WP 4.
Try to install the site on your PC creating a local copy using XAMP (for Windows).
In this way, you can:
download the MySQL database to have all the information of the
website locally;
install the latest wordpress platform locally (on your PC);
test the website thorugh common browsers.
At the end, you'll be sure about the compatibility and you can update the main site.
I have built my own theme with the Artisteer software; then i modified many PHP file to manage the loop in some special ways; so, to be sure that everything is working after an update of the site Wordpress version, i test everything on my PC.
For the vulnerability, please verify your plugin and all your theme file.
In some experiences, there are some plugin or simply some codes place somewhere in your theme which can create something like this:
> <div id="headerblock"> <center> <div style="left: -2227px; position:
> absolute; top: -3337px">
The only thing to do is check all the theme file and plugin to see where this code is placed.
Please check here for more information.
If you only change your password, probably it will not solve you problem because the malicious code is already inside your system.
Sometimes the malicious code can be placed directly inside the MySQL database.

Magento CSS not updating after copying site to another server

I done things a bit backward developing my new site, don't ask me why! But i built the site on the live server it will be hosted on first and the other day i created a sub-domain to hold a copy of the website so i can use it as a sandbox environment and test new plugins, to get PayPal working etc
I followed this tutorial
So it all worked fine! i have a copy of my site on a subdomain working. I had the infamous admin login redirect to itself issue but i sorted that, the reason it wasnt working was because i had my caches disabled in magento before i copied the site. So i had to enable them again in order to gain access ( If anyone knows why this is please share).
So my problem now is, i am updating the design of my website using the css and images in the skin folder. The problem is i update something in the css and load it onto my server and into the subdomain skins folder but nothing changes on the frontend UNTIL about 15 minutes later and me clearing all caches hundreds of times!! i really don't understand whats happening?
The links to my css/js and image folders are all correct in the head of the website. It's just like a time delay between me changing something in the css and the website updating itself.
Any information would be greatly appreciated.
Kind regards
Tom
Have you also disabled cached on Magento Admin? Perhaps you can try reloading the site on a non-cached based version of browsers (e.g. Incognito Mode in Google Chrome).
Your browser is also caching the external css files which is basically good for saving bandwidth of server and reducing page loading speed. But, for development purpose, you need to avoid css caching. On firefox or IE, you can use CTRL+F5 to reload a webpage without cached css.
If you do not want to use CTRL+F5, you can also add timestamp to your css file as URL parameter.
For example, style.css?<?php echo time();?>
You can also use Apache module to expire the caching.
.htaccess
ExpiresByType text/css "access plus 1 second"
http://httpd.apache.org/docs/2.2/mod/mod_expires.html

Fixing locally hosted wordpress site for migration (removing localhost)

A Wordpress novice and have set up my site locally using MAMP.
Unfortunately all the links to styles and I assume the database etc are by default pathed using 'localhost' so the site works ONLY on my machine. What is the correct way to change this pathing so that wordpress will correctly display the site?
For the database, you can edit the wp-config.php file at the root of your site.
As far as your styles are concerned, you'll have to go through the theme files that you've setup and adjust the relative path to those style sheets.
There are several options. Kyle is correct about editing wp-config.php, that will definitely take care of the new DB connection. However, I would advise against a manual adjustment of stylesheets and markup if possible. The easiest way for a novice might be this: export the DB from your local installation using "Settings > Export." Then, in your remote installation, use the WordPress Importer and it should tidy up all the links for you. This has worked for me several times.
You can learn more about other options here: http://wp.tutsplus.com/tutorials/hosting/how-to-break-a-wordpress-install-and-fix-it-again/
UPDATE: unless of course you've hardcoded "localhost" in your stylesheets and markup. In that case, use one of the solutions in the above link.
If your theme uses serialized data, you might have a problem when moving your website by simply doing a find and replace and changing the URL that way. I would recommend following WordPress's guide when you're moving your site.
http://codex.wordpress.org/Moving_WordPress
It involves using a special script to change the URL of your site.

Resources