Display Attribute value into a template using php

hi, i want to know if is possible to display attribute value into a template using php code.
I know that for a single post is possible to display any custom field but using ListingHive is it possible to do the same with Listing and Attributes

thanks

Hi,

Yes, it is possible. Please provide more details on which attribute you are referring to and on which page you need it to be displayed, and we will try to help.

thanks for the reply. The news is really good!

I want to use Attribute like this:

  • just to display the attribute’s value into a post template. I know that this ability is available by default (using %value%) but i want to display the attribute’s value anywhere in a template

  • i want to use the attribute’s value in cooperation with " WPcode" plugin to write PHP or HTML code using the attribute’s value (for example to check if the attribute’s value is greater to zero or not).

To help you understand what i want i’ll give you the following example about a POST and a CUSTOM FIELD with name “testcf”. To get the testcf’s value i’m using this code:

<?php
global $wp_query;
$postid = $wp_query->post->ID; 
$mydata=get_post_meta($postid, 'testcf', true); 
echo "the value of my custom field is: ".$mydata;
?>

i want to do the same but POST–>Listing and CUSTOM FIELD → attribute

thanks for the support

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work https://fvrr.co/32e7LvY

when you say it is possible in your answer what exactly did you mean?
Regardless of my previous answer how is it possible to to display attribute value on a post?

Hi,

This is possible with the help of a custom implementation. If you are familiar with coding, please check these links: