Listing Detail Page – Entry-title

This topic contains 2 replies, has 3 voices, and was last updated by  Stiofan O’Connor 9 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #59650

    uos-eee-maj
    Expired Member
    Post count: 3

    Hi there,

    RE: listing-detail.php
    Is there a way to output the contents of a GD custom field as a H2 below the current H1 Entry-title and before the geodir_post_taxomomies. This would only be output like this a particular CPT.
    e.g. Heading H1 (post title)
    Heading H2 (custom field)
    Paragraph Taxonomy Post Categories

    The following seems to generate this output:
    geodirectory_template_actions.php and geodir_action_page_title()

    Any help greatly appreciated,
    Mark

    #59734

    Paolo
    Site Admin
    Post count: 31206

    Hi Mark,

    there should be a hook to do that.
    I’ve asked to the developers to verify and let us know.

    Thanks for your patience,

    #59814

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    hello, yes you can do something like this, let’s say for example your custom field is calles “geodir_facebook_name” we would add this code to your theme functions file:

    
    
    add_action('geodir_details_main_content', 'add_my_custom_field_fb_name', 22);
    function add_my_custom_field_fb_name(){
        global $post;
        //check the field is set and has a value
        if(isset($post->geodir_facebook_name) && $post->geodir_facebook_name){
            echo "<h2>".$post->geodir_facebook_name."</h2>";
        }
    }

    to adjust where it is out put just increase the number, so try 33 if you want it below the image slider etc..

    Thanks,

    Stiofan

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount