Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter londonstyler

    (@londonstyler)

    Thanks Steve,

    Still need a bit of help. I am trying to add the address below the title on the single property page. I have tried amending the code you sent before to add to search results, although the following code doesn’t wo[rk (I’m not great with php as i’m sure you’ve noticed!)..

    add_action( ‘propertyhive_after_single_property_loop_item_title’, ‘function_to_add_address’, 1 );

    function function_to_add_address()

    {

    global $property;

    echo ‘<p class=”add-t”>’. esc_html($property->get_formatted_full_address());

    }

    Plugin Author Property Hive

    (@propertyhive)

    Thread Starter londonstyler

    (@londonstyler)

    Thanks, that works great. Is there a list of hooks that Property Hive uses that I can utilise?

    Plugin Author Property Hive

    (@propertyhive)

    Only in the template at the moment. So look in the Property Hive plugin, and the ‘templates’ folder, and open content-property.php for example and you can see the hooks in there. Same for content-single-property.php.

    We are rewriting our documentation at present which will include a full list of hooks.

    Thread Starter londonstyler

    (@londonstyler)

    ok – many thanks for your help

    Thread Starter londonstyler

    (@londonstyler)

    Hi Steve,

    I am adding a link to the summary description box, but this is being stripped out in the front-end. Is there a way around this? If this isn’t possible, is there a way of echoing the floorplan in the summary only for sold properties?

    Thanks as always for your help

    Thread Starter londonstyler

    (@londonstyler)

    Screenshots

    Plugin Author Property Hive

    (@propertyhive)

    We use the WP function get_the_excerpt() to output the summary in search results. This will strip HTML by default.

    I’ve done a Google for “get_the_excerpt() allow HTML” and there are lots of discussions about this. Here’s just one I’ve found:

    https://wpwhatnot.com/allow-html-excerpts/

    Thread Starter londonstyler

    (@londonstyler)

    Thanks,

    Yes, I did try this method which works fine for normal WP Posts, but not the PH excerpt. Alternatively, could we just amend the code you reviously supplied to echo the floorplan out in the summary?

    add_action( ‘propertyhive_single_property_summary’, ‘function_to_add_address_to_single’, 6 ); function function_to_add_address_to_single() { global $property; echo ‘<p class=”add-t”>’. esc_html($property->get_formatted_full_address()) . ‘</p>’; }

    Plugin Author Property Hive

    (@propertyhive)

    My apologies. After looking into this further we don’t use get_the_excerpt(). We call strip_tags directly in the template:

    https://github.com/propertyhive/WP-Property-Hive/blob/master/templates/search/summary.php#L19

    As a result the best this would be to either:

    1. Override the above template into your theme and remove the strip_tags() references.
    2. Use a snippet like so: https://gist.github.com/propertyhive/23d99af7378a4239a43a3d0ae57b5153
Viewing 10 replies - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.