I am building a theme, and in the options I have created a place for link color. I cant seem to get this into the theme in any reasonable way. The best I can do is to put it after wp_head ... but that doesn't seem right. The color will be a hex color so I cant just set up style sheets for a fixed number of colors and enqueue one of those conditionally. I suppose I could do this with jQuery but I really hope to not have to resort to that. I imagine all I am looking for is some way to enqueue an inline style, but does such a concept exist and if not what is the best way to go about it. I really thought link color options and the like would be commonplace and easy to implement.
|
|
|||
|
|
|
You would simply call that option inside of a callback, and hook it into First, set up your callback, which will print an inline style sheet:
The next step is to access your Theme option:
Now you need to apply the link color, which I'll assume is
Simply replace the HEX value as appropriate:
Putting it all together in your callback:
And that's it! You should see your inline stylesheet output in your document head, with the user's setting output for the link color HEX value. |
|||
|
|
|
|||||
|