I never used custom fields so I got a bit exited.

I'm not sure if I'm overusing them:

enter image description here

enter image description here

(I'm using them to display the title of images and images themselves. (big and small ones).

I used to do it with custom post types but it didn't make sense since those images belong only to that single posts.

Any suggestions?


With the limited view we can see of how you're using the custom fields, I don't think you're over-using them. However, I would try to clean things up a bit. "Featured Image" and "Featured Title" obviously are related to the same image. So are "Main Left Image" and "Main Left Title."

Rather than using public custom fields for these, I'd use private custom fields and a custom meta box to hold everything. This will clean things up quite a bit, make the post page seem less cluttered, and give you a clearer link between the related custom fields.

Private Custom Fields

The difference between private and public custom fields is the name. Prefix the name of a custom field with an underscore and it becomes "private." This means it doesn't show up in the list of custom fields for a post unless you tell it to, but you can still create it and read it back using the same add_post_meta() and get_post_meta() functions.

Custom Meta Box

All of the editable boxes in WordPress (title, post content, publication data, categories, etc) are meta boxes. You can create your own that identifies the specific custom fields you're using and sets them as appropriate

If you look around a bit, you'll find some great tutorials and instructions for how to add custom meta boxes:


What's wrong with using the built-in post attachments

$args = array(
    'post_type' => 'attachment',
    'numberposts' => null,
    'post_status' => null,
    'post_parent' => $post->ID
$attachments = get_posts($args);
if ($attachments) {
    foreach ($attachments as $attachment) {
        echo apply_filters('the_title', $attachment->post_title);
        the_attachment_link($attachment->ID, false);

You can get the same results and not overload your postmeta table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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