Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a plugin meta box (in the Wordpress admin) with the following fields and values:

Name of the div class selector= featured_content
Font family= Verdana
Font color= #000

They are stored in the Wordpress post meta table.

In the Wordpress front end, one of the content template has this div:

<div class="featured_content">
The quick brown fox jumps over the lazy dog.
</div>

How would I communicate with the Wordpress front end from my Wordpress meta box settings for that div? So that when the page is loaded containing the div class selector name of "featured_content", proper styling would be implemented based on the backend meta box settings.

I am thinking of running a JS code to scan all id and class selectors then query via AJAX to retrieve the settings and implement them, but I'm not sure if this is the best way.

Thank you for any tips.

share|improve this question
    
Not sure whether I understand this question properly, but should not the CSS for .featured_content take care of this? If the concern is how to have your own CSS files included in the wp-admin section, then this can be done. –  kidakaka Dec 13 '12 at 5:45
    
featured_content is generated by another plugin. I only add a new meta boxes below the admin section of that plugin using my new plugin as shown in my question. So if the page is loaded, how is it possible to retrieve the meta box settings and implement them to the div of interest? –  Codex Meridian Dec 13 '12 at 5:47
add comment

1 Answer 1

up vote 0 down vote accepted

The answer is really simple, I never thought at first. You will simply create a custom CSS function inside your plugin and then use PHP to output the meta values and hook that to wp head.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.