WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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? – Emerson Maningo Dec 13 '12 at 5:47
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

Your Answer


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.