Skip Navigation

[Closed] how to style the custom posts in administration?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 11 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by Caridad 11 years, 8 months ago.

Assisted by: Caridad.

Author
Posts
#15852

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

#15896

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

#15937

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

#15973

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

The topic ‘[Closed] how to style the custom posts in administration?’ is closed to new replies.