Display custom field outside of sidebar

This topic contains 4 replies, has 3 voices, and was last updated by  Paolo 7 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #253177

    David Wang
    Buyer
    Post count: 12

    Hi, I want to display a custom field at the top of the sidebar. I thought I can grab the postmeta and hook it to

    geodir_detail_sidebar_inside

    . However I see that your custom fields are not saved as postmeta.

    How can I retrieve the custom field value so I can output it where I want? Thank you

    #253312

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    Example:

    
    
    global $post;
    echo $post->post_address;

    will show the address.

    Custom fields have the geodir_ prefix.

    Let us know if this helped.

    Thanks

    #253593

    David Wang
    Buyer
    Post count: 12

    Thank you. For anyone else who is wishing to do the same, here’s the code I used. YMMV

    add_action( 'geodir_detail_sidebar_inside', 'child_logo_sidebar_top', 5 );
    function child_logo_sidebar_top() {
        global $post;
        ?>
        <div class="geodir-company_info">
            geodir_logo; ?>"
                alt="" width="" height="" border="0" />
        </div>
        <?php
    }
    
    #253625

    Helen Burbage
    Expired Member
    Post count: 4

    Thank you, for anyone trying to work this out.
    I took a copy of listing-listview.php from the plugin template directory and simply added
    the code in there, copied it to the child theme directory under geodirectory.
    Thanks
    Helen

    #253823

    Paolo
    Site Admin
    Post count: 31206

    Thanks for sharing 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket