Drupal theme isn't responsive in different servers - drupal

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.

Related

'Visual Composer' plugin is outputting weird image links

Morning everyone, i'm having a super weird issue with my recent wordpress migration. I moved the (working) site to another webspace and i'm slowly running out of ideas (jk, already ran out).
Issue: After the migration, the plugin Visual Composer is outputting nonsense image links to the frontend that look like this: https://i.imgur.com/7RocCmE.png instead of the uploaded images url. Result: No images are showing on the frontend.
This issue only happens when i use the single image block provided by VC itself. Inputting an image the wordpress way, inside of a text block, works.
What could be the reason for this? i'm super thankful for any advice since i'm not a programmer.
I have already tried:
Enabling wp debug, not getting any errors
Installing different versions of Visual Composer, multiple times
Reinstalling Wordpress, multiple times
disabling all plugins
completely reinstalling and reuploading everything from scratch
different php versions
As I saw in your screenshot with the src attribute of your image and it has data-src attribute also, I think that it's because the new site (or maybe the new hosting) is using lazy load which will update all images source of the site to the lazy load image for better performance.
Lazy load images mean that the image won't load at the beginning, when you start to scroll down to each section, the images of this section will be loaded. In this way, the site will be optimized and won't load many resources at the beginning.
I think you can:
Check if there is any cache plugin installed, try to deactivate this plugin.
Check with the hosting provider if there is any cache setting installed, try to deactivate this setting also.
See if the image is working in the backend or not, if it's still loaded in the backend, I'm pretty sure that it's the cache issue. If it doesn't load in the backend, I think there is something wrong with your theme source code.
Compare the hosting environment, especially the PHP version of the old and new site to see if there is any differences.

Restarting a wordpress project

I am a freelance developer, and I normally build sites from scratch without using any code generating sites like WordPress or Square Space. But my current client insists on using WordPress. However, I am rescuing this project from a previous developer who made a big mess because from the looks of it does not seem like they knew what they were doing.
Is there a way for me to restart everything, on a clean slate and template on WordPress? I would like to have none of what the previous developer has done. Also is there a way for me do do direct coding using HTML, CSS, JavaScript etc on a WordPress site?
Yes, you just need to look into how to create a theme, since themes are the basis of the Wordpress structure. Ultimately, if you have the code for a website, it can be broken into separate files that Wordpress can use.
See: http://www.wpexplorer.com/create-wordpress-theme-html-1/
If the previous developer has done all the work in the theme files, then simply switching the theme to a default theme (Like Twenty Sixteen) will give you a nice clean slate to dig in and jump off with. You will want to create a child theme of any existing theme if you want to make any changes. If, however, the developer has messed with other files besides the theme folder, then you will most likely want to export the content only (as a logged-in administrator, go to Tools > Export (here's a screenshot))
Then on a new environment (I prefer testing these things first on a local virtual environment like VVV, and then transition to a development subdomain on the same server that the site will eventually go live on and securing it with an htaccess user/password to block curious eyes), import the content on a fresh installation of wordpress via the same menu (Tools > Import). This will give you a fresh installation with the content that's been created, but without any of the mess.
For more information about importing content - here's the codex article.
I hope that's a good start - but if I've glossed over anything you don't understand, let me know - I'm happy to help.

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

Use Wordpress for static WebSite

I want to create a static website and use wordpress only to "compose" the website. I want to create a template that only use the same header and footer and change the content of the page (home, contact ecc dcc). My site is not a blog or any other type of site that needs CMS I only want to use Wordpress to have only one header and footer and don' t want to change it in all pages when I need some customization to it. I hope I was clear enough! Thanks!
You can create a site in WordPress (or any other CMS) on your own local computer, then save a copy using an offline browser such as HTTrack. Then upload the HTTrack saved HTML to your webhost.
This will make your site faster, as there will be no need to execute PHP on page requests, and the webserver will use its default caching headers. (Also, you get the option of using a cheaper hosting without support for PHP and MySQL.)
Any time you change the site, you'll need to edit the live WordPress version, save it again, and reupload the files.
Disclaimer: I'm dev of the WP Static HTML Output project.
It's been around for a few years and still has 5k+ active installs, but jazzing it up with some more features now and its whole purpose is to allow you to use WordPress for your site development and export to a static HTML version for speed, security and portability.
For the OP, the basic FTP publishing option may be of use. For more advanced cases, there are services like Netlify which can auto build/deploy your static site from a Git branch.
In the Settings | Reading admin page, choose a static page for your front page display. Build your site out using Pages instead of Posts. Each Page will inherit your site's standard header and footer. Create your Main Menu from the Appearance | Menu admin page to hook together your Pages. Use widgets and standard HTML links as needed. Then dress up your site with one of the many available themes.
A bit late to the table on this one but it seems that Wordpress is totally overkill for a static site. Wordpress pages can be cached with cache plugins but when any Wordpress site loads there are a number of scripts and custom php functions that run each time a page loads.
Why not just build a flat file website and simply include your header and footer with PHP? Far quicker to set up and based on your question it seems that this is simply what you need.
Added to this, you won't have an admin area for your site or a database, just the files on the server - surely this makes your site less hackable too. An added bonus is a really easy site to version control with Git or SVN.
If there's someone else out there wanting to use a static site generator over Wordpress, here's a script called WP Static which does just this: http://mossiso.com/code/make-wordpress-static
Another great solution to this problem is to use a specific software that is created exactly to do that. For Mac, for example, there's a software called Hammer that "compile" your site every time you save and includes your header and footer to the page. Is really useful.

CSS not applying in my DRUPAL 7 site on localhost

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

Resources