*

MB Themes

Re: Custom field
« Reply #15 on: January 08, 2024, 01:20:50 PM »
User osc_item_meta_id() or osc_item_meta_slug() functions to allocate correct field you want to include.

Code: [Select]
<?php if( osc_count_item_meta() >= ) { ?>
      <div id="custom_fields">
        <div class="meta_list">
          <?php while ( osc_has_item_meta() ) { ?>
            <?php if(osc_item_meta_id() == 123 || osc_item_meta_slug() = 'only-this-field-by-slug') { ?>
              <div class="meta">
                <strong><?php echo osc_item_meta_name(); ?>:</strong> <span><?php echo osc_item_meta_value(); ?></span>
              </div>
            <?php ?>
          <?php ?>
        </div>
      </div>
    <?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Custom field
« Reply #16 on: January 08, 2024, 01:38:36 PM »
I understand, Slug takes away fields that I don't need.


And if I want to hide two elements in slug, how do I do that? I have already hidden one element and it works well.
« Last Edit: January 08, 2024, 02:00:41 PM by Roberto Klapper »

Re: Custom field
« Reply #17 on: January 08, 2024, 03:54:04 PM »
Problem solved, just learn and think for yourself. did it like that.


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