WordPress Tips and Hints
Change language to german
- Download language files from WordPress Germany
- create directory language under wordpress/wp-content
- copy unzipped files into this directory
- edit wordpress/wp-config.php: Enter bold text (according to copied files) define ("WPLANG", "de_DE");
Plugins
- Theming
- See [1]
- When using Agama custom theme and moving your homepage to https Chrome is complaining that the site is insecure since some resources are loaded via http instead of https.
- This can be fixed by:
- Open dev tools in Chrome, reload page and seek the resources loaded via http. Typically these will be theme resources like main icon etc.
- Open Hostpoint, go to your database and open phpmyadmin; go to configurations table and select Agama configuration. Copy old value for backup!
- Here you can find something like "agama_logo";s:69:"http://. Update to https and increment the value to s:70 then press 'OK'. If you missed updating the value the cell content gets reset by Agama after site reload!
- This can be fixed by:
- Akismet
- already contained, but not activated.
- Events Calendar
- This plugin allows to have a calendar based blog.
- Installation
- Download from [2] and install as described.
- Localize the calendar by downloading the localization files from here and upload the po and mo file to WordPress/wp-content/plugins/calendar.
- Backup
- Use plugin 'WP-DBManager' to backup all database content.
- Backup theme, icons, plugins etc. with: [3]. Do mind that you need to install this plugin by yourself (strangely...).
- Localization
Bugfixes
Sidney Theme and Wordpress Photo Album
This issue is described here but no solution presented: https://wordpress.org/support/topic/call-to-action-button-not-working-3/ I found out that it is a combination of the WordPress Photo Album and the Sidney theme. The WPPA-plugin seems to be loaded very generically and thus the following window.onpopstate-function is registered on the hero-part as well:
window.onpopstate=function(e){
There in the last line the whole page is just reloaded what we do not want here: It should just smoothly scroll down. Thus, in the file wppa-all.js I just commented out the last
document.location.reload()
call..
Cloning a WordPress instance
(When I changed my company's name I had to copy one WordPress instance to another.) I managed to clone one WordPress instance in the following sequence:
- Install plugin XCloner on WordPress instance to clone. Set up your preferred password. Configure backup-directory. (I created the server-locally directory by means of FTP.) Create directory '<wp-installation>/administrator/backups' which is used as a temporary directory.
- Create backup, e.g. <old site>/xcloner-backup/xy.tar
- Then I installed a new WordPress instance. (HostPoint Control Panel, installation directory <new site>/wp...) Write down DB-server, DB-username/-password. Alternatively (or even better) just create a new DB instance.
- Restore the cloned WordPress instance:
- copy tar file to e.g. <new site>/xclone-backup
- copy <old site>/<WordPress-dir>/wp-content/plugins/xcloner-backup-and-restore/restore/XCloner.php and TAR.php to <new site>/xclone-backup.
- Open browser with <new site>/xcloner-backup/XCloner.php
- Config all database and server settings, then execute the installation. Skip failing database operations..., refresh browser if things seem not to go on any further...
- Edit <new site/<WordPress-dir>/wp-config.php to configure new database settings.
- Open browser to new WordPress instance.
- Now you have to:
- Reactivate and reconfigure all plugins (all paths must be updated)
- Reconfigure Theme, Widgets etc.
- Update all referenced media on every page and post: All paths must be updated! (Maybe following plugin could be helpful: Change-WP-URL.)
- Optional: Copy <new-site>/<wp-dir>/index.php to <new-site>/index.php so that WordPress instance can be called up with <new site> (without /wp)
- Remove the directories <old site>/xcloner-backup and <new site>/xcloner-backup.
Forward to other site with timeout
Source: Htmlbasix In WordPress go to 'Appearance', 'Editor' then select 'Header (Header.php)' and enter the head-code within the <head>-tag. E.g.:
<head> <META HTTP-EQUIV=Refresh CONTENT="5; URL=http://neshendra.com">
and enter a notable message on the frontpage. (see next entry)
Show a floating message in the WordPress installation
See Yahoo1 and Yahoo2 Log into WordPress and go to 'Appearance', 'Editor', select 'Header (Header.php)' and enter the following code at the end:
<div class="customScroll">
<h1>necetra.ch ist nach neshendra.ch gezügelt! <h2>Sie werden automatisch weitergeleitet. <h1>www.necetra.com has been moved to neshendra.com! <h2>You will be forwarded in any second.
<style> div.customScroll { z-index:1000; position:absolute; top:40px; margin-left:100px; /* left:50%; */ overflow:auto; width:80%; /*150px; */ /* height:120px; */ border:10px lightblue solid!important; background:#000; color:white; text-align:center; opacity:0.80; -moz-opacity:0.80; filter:alpha(opacity=80); } </style>
CSS
- Tool for testing CSS settings
- Placing div elements around: [5]
Favicon
see | WordPress Creating a favicon
- Create favicon using e.g. | http://www.favicon.co.uk/, normally a image sized 16px x 16px
- Copy favicon.ico to <host>/WordPress/wp-content/themes/<theme, e.g.mystique>
- (If needed) clear the local browser cache, see Firefox_Tips_and_Hints#Clearing the favicons
Links
Here some links which helped me to solve different important points:
- Wrapping text around images
- WordPress as CMS 1 / WordPress as CMS 2
- RSS feeds on non-blog pages 1 / RSS feeds on non-blog pages 2
- Open link in a new window
Missing fonts / resources
If a font or another resource does not appear properly check the console for an error like this:
Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
In this case extend the file .htaccess by following line:
Header add Access-Control-Allow-Origin "*"
See here.
Create new WordPress-Website and then replace instances
- Create new WordPress instance on a sub-domain
- To replace the top-domain go on like following description: [6]
- In my case I was not able to do Step 9 (upload folder)
- Additionally I had to update the 'Document Root' on Hostpoint's Websites page. After the change I had to wait aprox. 15 minutes until cache got invalid.
- Additionally I had to:
- in WordPress, Elementor, Tools, Replace URLs: replaced old URL by new
- updated all images in Design, Customizer
- gone through all pages and updated the resources therein