Extend PixelMenu with New Icons

We made it reasonably easy to extend icons in PixelMenu for WordPress there are just a few things you need to have:

1. The frontend ‘pretty name’
2. A name for the array
3. The css file location
4. The icon prefix inside the file
5. A prefix class used for output

Our function will read the file you input and gather up all of the icons in the files based on the other input variables.

Practical Example

The following example would load the font css file from http://www.yourdomain.com/wp-content/themes/theme-namem/assets/fonts/font-awesome/css/font-awesome.css with a ui display name of Test Icons. In the frontend it would use the $tag: fa

function prefix_map_new_icons(){

    $pretty_name = 'Test Icons';
    $array_name = 'test_icons';
    $file_location = 'http://www.yourdomain.com/wp-content/themes/theme-namem/assets/fonts/font-awesome/css/font-awesome.css';
    $icon_prefix = 'fa-';
    $css_prefix = 'fa';
    $tag = 'font-awesome'; // used to load front end assets

    // automatically map the new file
    pixel_map_icons($pretty_name, $array_name, $file_location, $icon_prefix, $css_prefix, $tag);
    
}
add_action('pixel_extend_icons', 'prefix_map_new_icons');
0 People Found This Helpful.

Viewed 253 times.