Advertisement:

Author Topic: get custom field in loop-single-premium.php  (Read 708 times)

armaniworld

  • Newbie
  • *
  • Posts: 23
  • Gwolla.co.uk
get custom field in loop-single-premium.php
« on: May 13, 2017, 02:47:11 pm »
Hi i'm using zara theme,

i use this code in loop-single.php to add my custom field bedrooms to the search pages.

Code: [Select]
<div class="i-beds">
 <?php 


                  
//this part grabs the array of meta data and puts it in a variable called $getitemmeta
                  
$getitemmeta=osc_item_meta_value(); 
           
                  
//this part takes one particular value from that array and puts it in a variable called $fieldvalue   
                  //you have to know the "key" number for the corresponding value, mine was 1
                  //the "s_value" stays
                  
$fieldvalue=$getitemmeta[1][s_value]; 
 

                  
//
                  
echo $fieldvalue;  ?>

</div>


i thought it would be simple and just copy the same code to the loop-single-premium.php to make it appear on featured ads also but this doesn't work. it doesn't output any values just blank. so basically the above code works in loop-single but not loop-single-premium

can anyone help
thanks

armaniworld

  • Newbie
  • *
  • Posts: 23
  • Gwolla.co.uk
Re: get custom field in loop-single-premium.php
« Reply #1 on: May 13, 2017, 03:12:24 pm »
nevermind, solved this by using osc_get_premium_meta() instead.