Support » Fixing WordPress » Custom fields display in table

  • Resolved dapis72



    I am new member here, so everyone hello.

    I am trying to do some blog pages where i will present some things with multiple custom fields in a post. My question is, since i have created fieldset, how to display this custom fields in post?

    I tried with single.php and getcustomfield, which works fine, but i would like to display customfields in a table. But this works only for single post. When i have more posts on page, customfields dont show up.

    Since you are more experience, is this way to use custom fields good or not?

    I would appreciate any idea or solution.

    This is how look JP Custom Field:

    Fieldset: Avtodom change delete
    Field Slug Type Enabled
    Vrsta avtodoma
    ad_new_vrsta_avtodoma select Yes

    Znamka avtodoma
    ad_new_znamka select Yes

    Leto predstavitve
    ad_new_letnik select Yes

    ad_new_motor inputtext Yes

    ad_new_slika01 uploadmedia Yes

    Thank you. Damian

Viewing 6 replies - 1 through 6 (of 6 total)
  • s_ha_dum


    I am not sure I understand you completely but I’ll try. Forgive me if I am misinterpreting something.

    1) Anything you put in single.php will only show up when you display a single post only. To have the code operate for multiple posts you need to put the code on index.php, or any of several other template files depending on how your theme works.

    2) I am not aware of a getcustomfield() function. Possibly it is new with WP 3.2? There is a get_custom_fields(). Is that what you mean?

    3) Whatever the case, custom fields are tied to posts so you would need to retrieve the custom fields for each post.




    Thank you for replay. Yes I mean get_custom_fields.

    Well my question was, if I can organize somehow a table with many custom fields to display in a post?




    Yes, you can display custom fields as a table but I’m still not sure what you are trying to do.

    Do you want to display all of the fields assigned to one post, or all of the fields assigned to multiple posts, or are you trying to display all of the available fields for all posts?



    For example….let’s say 1 post is like 1 car.

    So I would like to show for each post all the characteristic of the car.

    Nice view would be to put that in table.



    So, you have a post about a car and you have things like horsepower, gear ratio, fuel economy, whatever, in the custom fields, right? Then use <a href="">get_post_custom()</a> and when you loop through it (foreach, for example) build a table.



    Thx for help, well I am very new in programming 🙂

    So I need to finf out about this foreach and where to put this….but i will look for solution. Thx for your time anyway.

    I find nice thing like Wp-Table, but have to find how to include my vustom fields.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom fields display in table’ is closed to new replies.