Advertisement:

Author Topic: How to Display contents of custom fields?  (Read 616 times)

mrokovsly

  • Newbie
  • *
  • Posts: 3
How to Display contents of custom fields?
« on: August 18, 2017, 10:58:58 pm »
Hi.

Please forgive me that my English is not good.

I would like to display the contents of the custom field on the listings.
For example....
"Age" was set as an item of the custom field.
I want to display Age in listings.

I try to use  "osc_item_field()".
but I do not know how to use it.

Thank you.

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: How to Display contents of custom fields?
« Reply #1 on: August 18, 2017, 11:03:23 pm »
Hi. From what I know, in bender theme, those custom fields apear in the item page.

Code: [Select]
<div id="custom_fields">
            <?php if( osc_count_item_meta() >= ) { ?>
                <br />
                <div class="meta_list">
                    <?php while ( osc_has_item_meta() ) { ?>
                        <?php if(osc_item_meta_value()!='') { ?>
                            <div class="meta">
                                <strong><?php echo osc_item_meta_name(); ?>:</strong> <?php echo osc_item_meta_value(); ?>
                            </div>
                        <?php ?>
                    <?php ?>
                </div>
            <?php ?>
        </div>

mrokovsly

  • Newbie
  • *
  • Posts: 3
Re: How to Display contents of custom fields?
« Reply #2 on: August 24, 2017, 05:47:31 pm »
Thank you for answering.
When I tried it, I was able to display the contents of the custom field.

I will ask you a further question.

How to show Certain custom fields.

If you answered, the contents of all custom fields will be displayed.

I want to display only one of several items.

Thank you.

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: How to Display contents of custom fields?
« Reply #3 on: August 24, 2017, 11:36:06 pm »
Code: [Select]
<div id="custom_fields">
            <?php if( osc_count_item_meta() >= ) { ?>
                <br />
                <div class="meta_list">
                    <?php while ( osc_has_item_meta() ) { ?>
                        <?php if(osc_item_meta_value()!='' && osc_item_meta_name()=='additional-field-name') { ?>
                            <div class="meta">
                                <strong><?php echo osc_item_meta_name(); ?>:</strong> <?php echo osc_item_meta_value(); ?>
                            </div>
                        <?php ?>
                    <?php ?>
                </div>
            <?php ?>
        </div>