• Resolved Craig

    (@cpfusion)


    I was just wondering if there was a way to programmatically check the status of the “On Market” setting?

    I’d like to create a conditional statement that displays alternative content if there are no properties currently “On Market”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Property Hive

    (@propertyhive)

    Hi Craig,

    We have a template you can override which is used in the event of there being no properties found:

    https://github.com/propertyhive/WP-Property-Hive/blob/master/templates/search/no-properties-found.php

    More about overriding templates:

    https://docs.wp-property-hive.com/developer-guide/overriding-templates/

    Let me know if I’ve got the wrong end of the stick or if any further questions,

    Steve

    Thread Starter Craig

    (@cpfusion)

    Hi Steve,

    I am currently using a Beaver Builder custom layout (code shown below). So when there are no properties the placeholders appear but without the actual property information inserted. So I was hoping there might be a way to wrap the code in a conditional (similar to the ‘_department’ conditional), but based on the output of the “On Market” checkbox.

    I reckon it could work if there was a way I could check the result of the “On Market” checkbox, then I could use something like [wpbb-if post:custom_field key='_on_market' exp='equals' value='true']code block here[/wpbb-if]

    Kind regards,
    Craig

    <div class=“search-result">
    
    [wpbb-if post:featured_image]
    <div class="fl-post-image">
    	[wpbb post:featured_image size="large" display="tag" linked="yes"]
    </div>
    [/wpbb-if]
    
    <div class="fl-post-text">
    
    ?? ?<h2 class="town">[wpbb post:custom_field key='_address_three']</h2>
    
    ?? ?<p class="fl-post-title">[wpbb post:custom_field key='_address_name_number'] [wpbb post:custom_field key='_address_street']??[wpbb post:custom_field key='_address_two'] [wpbb post:custom_field key='_address_three']??[wpbb post:custom_field key='_address_postcode']</p>
    
    ?? ?<h2 class="price">£[wpbb post:custom_field key='_price_actual'] [wpbb-if post:custom_field key='_department' exp='equals' value='residential-lettings']pcm[/wpbb-if]</h2>
    
    ?? ?<div>
    ?? ?	[wpbb post:excerpt length="20" more="..."]
    ?? ?</div>
    
    ?? ?<div class="rooms">
    ?? ? ? ?<span class="rwd-line"><i class="far fa-bed"></i>&ensp;BEDROOMS x <strong>[wpbb post:custom_field key='_bedrooms']</strong><em>&ensp;|&ensp;</em></span>
    ?? ? ? ?<span class="rwd-line"><i class="far fa-bath"></i>&ensp;BATHROOMS x <strong>[wpbb post:custom_field key='_bathrooms']</strong><em>&ensp;|&ensp;</em></span>
    ?? ? ? ?<span class="rwd-line"><i class="far fa-couch"></i>&ensp;RECEPTION ROOMS x <strong>[wpbb post:custom_field key='_reception_rooms']</strong></span>
    ?? ?</div>
    
    ?? ?<div class="fl-post-more-link">
    ?? ? ? ?	[wpbb post:link text="custom" custom_text="VIEW THE PROPERTY"]
    ?? ?</div>
    
    </div>
    
    </div>
    • This reply was modified 2 years, 9 months ago by Craig.
    • This reply was modified 2 years, 9 months ago by Craig.
    Plugin Author Property Hive

    (@propertyhive)

    Hi Craig,

    The _on_market meta value will either be empty or ‘yes’.

    Hope that’s what you’re after.
    Steve

    Thread Starter Craig

    (@cpfusion)

    Hi Steve,

    Many thanks… that was exactly what was required.

    Much appreciated.

    Craig

    • This reply was modified 2 years, 9 months ago by Craig.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Check “On Market” status’ is closed to new replies.