I am working on an Addon for WPLMS to automate some of the manual tasks. Will extend the list, as things progress.
1 2 3 4 5 6 7 8 9 10 11 |
if ( (isset($_GET['action']) && $_GET['action'] != 'logout') || (isset($_POST['login_location']) && !empty($_POST['login_location'])) ) { add_filter('login_redirect', 'my_login_redirect', 10, 3); } function my_login_redirect() { $location = $_SERVER['HTTP_REFERER']; wp_safe_redirect($location); exit(); } |
The new WOFF 2.0 webfont format is coming to chrome.
“The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases).”
http://www.fontsquirrel.com/tools/webfont-generator
http://everythingfonts.com/ttf-to-woff2
1 2 3 4 5 6 |
@font-face { font-family: MyFont; src: url('myfont.woff2') format('woff2'), url('myfont.woff') format('woff'); } |
1 2 3 4 5 6 7 8 9 10 |
add_action( 'unload_textdomain', 'my_unload_textdomain' ); function my_unload_textdomain( $domain ) { switch($domain){ case "remove_textdomain": unload_textdomain( 'remove_textdomain' ); load_plugin_textdomain( 'remove_textdomain', false, $your_location.'/languages/' ); break } } |
Sometimes you might like to store all language files in your own central location, so that translators have one easy place to access all language files.
Put the above into the functions.php and add textdomain handling for those you want to centralize.
Most current plugins should include the option to store language files to the global WordPress language folder, but that is sometimes just not enough :) Its all about options ;)
Make sure that the viewbox, width and height are defined within the SVG.
Many older browsers misbehave, if those are defined in the image source tag only and not in the image file itself.
1 2 3 4 5 6 |
<svg version="1.1" id="mainLogo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 180.7 166.9" width="230" height="212" enable-background="new 0 0 180.7 166.9" xml:space="preserve"> .... </svg> |
WPLMS is a Learning Management System for WordPress. Translation files in WPLMS are located in
These language files will be overwritten with new files on every update, destroying any custom translation changes.
Move your theme into a child theme and translate your theme there (/wp-content/themes/your-child-theme/languages/).
Make sure that language files are loaded from your child theme. Add the following action to your functions.php and use “vibe” as the domain, not the actual theme name.
1 2 3 4 5 |
add_action( 'after_setup_theme', 'my_child_theme_setup' ); function my_child_theme_setup() { load_child_theme_textdomain( 'vibe', get_stylesheet_directory() . "/languages" ); } |
Use the global language folder for the WPLMS plugin translations. The WPLMS plugin loader checks, if a global language file actually exists :)
1 2 3 4 5 |
if ( file_exists( $mofile_global ) ) { load_textdomain( 'vibe', $mofile_global ); } else { load_textdomain( 'vibe', $mofile_local ); } |
I suggest using Poedit, as it allows you to do the translation on the Desktop. It also offers options to update your file with an updated WPLMS language file, allowing you to add new translation strings if needed :)
A. Create the structure for the update and download new PO files from WPLMS
B. The target structure / your current language files
C. Open your current .PO file from target structure
D. Update with new and matching .PO file from A. (Catalog -> Update from POT file)
This will check for new or obsolete strings and update your language file.
E. New strings added
F. Obsolete strings removed
G. Save and upload updated .PO + .MO files from target structure to server.
Again, make sure to use the global language folder and the child theme languages folder !
Panic time after updates is over :)
Twital is a small addon for the Twig template engine, it adds shortcuts and makes Twig’s syntax more suitable for HTML based (XML, HTML5, XHTML, SGML) templates.
Should be also no problem to integrate it with Timber, currently looking into that ;)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<ul t:if="users"> <li t:for="user in users"> {{ user.name }} </li> </ul> // shorter than : {% if users %} <ul> {% for user in users %} <li> {{ user.name }} </li> {% endfor %} </ul> {% endif %} |