osompress / simple-social-icons

Plugin: Simple Social Icons
62 stars 33 forks source link

Re: "Add an additional icon in version 2.0" -- Not sure instructions are complete or maybe they are just not too clear #51

Closed stormhillmedia closed 7 years ago

stormhillmedia commented 7 years ago

in instructions: "plugin_dir_url(FILE) . 'my.svg#social-my-icon to the path of your SVG file, where social-my-icon is the ID of the icon in the SVG file, as shown below."

I am not sure where the file shown below the instructions is supposed to go. Do I add the svg image to the folder, custom folder, or what?

This hook is about 90% useful but if this part is not more clear the whole effort is wasted and it is easier to write my own code.

nickcernis commented 7 years ago

@stormhillmedia It depends where you're adding the code.

If you're adding it as a site-specific plugin (so that you don't lose custom icons if you switch themes), plugin_dir_url() is correct and the SVG should go in your plugin's root directory. If you're adding it to an existing theme, you'll have to adapt the path accordingly so that it returns the URL of your custom SVG.

https://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri

I've added a note to the wiki entry to that effect. If it's still not clear or you need further help with this, feel free to let me know.

nickcernis commented 7 years ago

I added a link in the docs to an example plugin that shows how to add icons.