We got site written on Drupal.
We want to make Nginx caching but there is one problem we met.
Nginx caching works perfect, but if user A will go to page
http://domain.com and nginx cache it. User B use mobile theme http://domain.com/?theme=mobile and went to http://domain.com/ , he will see desktop version instead of mobile version.
I want to make something like http://domain.com/any/url/path for desktop version
and http://domain.com/mobile/any/url/path
Is it possible? Where can I found information about how to do it?
There is this module named Mobile Switch to automatically switch between themes depending on the device used to visit the website : https://www.drupal.org/project/mobile_switch
It was easily than I expect.
We use ThemeKey module so I added some rules depends on url like "drupal:path visuallimpaired/%" and just make my own plugin that use hook_url_inbound_alter and hook_url_outbound_alter to add and remove prefixes, and it works.
Related
I have made a small text change on one of my wordpress website using elementor 3 but is not able to publish on live site. Solutions that I have tried so far but unsuccessful.
Clear Browser cache, WP plugin cache and purge website server cache.
Made changes again and view in incognito mode
Change Elementor CSS Print Method to Internal Embedding
Regenerate CSS and data in Elementor tools settings
Note: The only way I see change made is by adding ? (querymode) to the url, but not without that.
The issue we were having was due to old hosting, since the DNS was pointing to old host, the changes made was reflecting in old WP admin but not in new one
All we have to do is point the DNS to new host. That resolved a problem .
I am not able to edit the Wordpress site at all. The dashboard looks like its not loading css. But also the links are not working, each time I press anything on the bare-looking dashboard, it takes me to Page not found. I am facing this issue because I changed the admin password from phpMyadmin using cPanel. From that moment, this is all messed up. It would be awesome if I get a solution for this. (Ps. I do have a backup of the site but it is old, so it does not have a lot of changes done recently, so I cannot roll back to old version
If you are using any cache plugin, then deactivate it, clear your browser cookies, also try to access it from different IP from another place.
Also, check this link for a better understanding.
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.
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.
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