Hi,
i would like to style a little bit the generated code for my custom posts (i mean: /wp-admin/post-new.php?post_type=mycustompost)....
I noticed that the generated code introduces a random number:
<div id="wpcf-select-tipi-440621159-wrapper" class="form-item form-item-select wpcf-form-item wpcf-form-item-select"><label class="wpcf-form-label wpcf-form-select-label" for="wpcf-select-tipi-440621159">Tipi</label>
<div class="description wpcf-form-description wpcf-form-description-select description-select"></div>
<select id="wpcf-select-tipi-440621159" name="wpcf[tipi]" class="wpcf-form-select form-select select">
<option value="1" class="wpcf-form-option form-option option">1</option>
<option value="2" class="wpcf-form-option form-option option">2</option>
<option value="3" class="wpcf-form-option form-option option">3</option>
<option value="4" class="wpcf-form-option form-option option">4</option>
</select>
</div>
Is there a way to style this code? How? I just would love to put two or three fields in the same row....
Regards,
Marcello
Dear Marcello,
To add some CSS to the admin interface there is the admin_head filter. You need to attach to it and display any custom CSS there. Something like this:
function my_admin_head() { ?>
<style type="text/css">
#poststuff .wpcf-form-item { width: 50%; float: left; }
#poststuff .inside { overflow: hidden; }
</style>
<?php }
add_action('admin_head', 'my_admin_head');
Please let me know if there is anything else that I can assist you with.
Regards.
Caridad
Hi!
Thanks a lot, but my problem is still not solved... the "random number" changes every time i reload the page.... I mean, for example that in the ID wpcf-select-tipi-440621159-wrapper the number 440621159 changes every time...
Is this a bug or what?
Regards,
Marcello
Dear Marcello,
Those ID's are used for javascript and are not meant to be used for styling. Can you use a different selector? The id of the metabox and classes of the fields, like #group .wpcf-select-item or similar?
Regards,
Caridad