Override a wordpress theme language file using a custom plugin

I am using a wordpress theme that contains several language files. I would like to modify a language file to “white label” the theme I am using. I will also be making other admin-css changes to the theme, therefore, I’d like to create a plugin that allows me to do all of this.

What I am unsure of how to do is create a custom plugin that would override a themes language file – is this possible?

Read More

I have so far tried this:

<?php 
/*
Plugin Name: Layers Whitelabel test
Plugin URI: http://www.skizzar.com
Description: Plugin to whitelabel layers for Skizzar
Author: Skizzar
Version: 1.0
Author URI: http://www.skizzar.com
*/ 

function set_myplugins_languages() {
    load_textdomain( 'layerswp', plugin_dir_url( __FILE__ ) . '/language' );
}
add_action('init', 'set_myplugins_languages');

But so far no joy – as in, it doesn’t load the new language file in place of the existing one.

Anyone got any ideas on how this can be achieved?

Related posts

1 comment

  1. Well, why do you need a plugin for this?

    The theme style.css have similar code to

    Plugin Name: Layers Whitelabel test
    Plugin URI: http://www.skizzar.com
    Description: Plugin to whitelabel layers for Skizzar
    Author: Skizzar
    Version: 1.0
    Author URI: http://www.skizzar.com
    

    So you can simply change theme display name, url, author etc.

    Basically it’s easy to do, however it’s against theme copyrighting 😉 Even if this is a GPL theme you should refer to original developer.

Comments are closed.