hook for post_profile bio?

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

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #198824

    EH
    Expired Member
    Post count: 96

    I realize this may be beyond this forum’s support scope but I figured it was worth asking. I created a custom field for a user to upload a logo to their listing if they are a paid listing. Right now the logo appears on the bottom on the bio, you can see here:
    http://new.electronichouse.com/places/united-states/georgia/atlanta/listing-audio/atlanta-audio-automation/

    I was told to find a way to put this before the description. I was hoping you had a hook like before_description or something. Any ideas?

    Also here is the code I’m using in my functions.php

    
    
            //Add service area tab to GeoDirectory listing page
            add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend_service');  
            function geodir_detail_page_tab_list_extend_service($tab_array) {
                global $wpdb;
                $id = get_the_ID();
                $ServiceArea = $wpdb->get_var("SELECT geodir_service_area FROM wp_geodir_gd_place_detail WHERE post_id = $id ");
                if ($ServiceArea !=''){
                    $tab_array['service_area_tab'] = array( 
                    'heading_text' =>  __('Service Area',GEODIRECTORY_TEXTDOMAIN),
                    'is_active_tab' => false,
                    'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true,'service_area_tab'),
                    'tab_content' => '');    
                    return $tab_array; 
                }
                
                else {return $tab_array;}
               
            }
            
            //Add Content to GeoDirectory Tabs 
            add_action('geodir_after_tab_content' ,'geodir_my_new_tab_content');
            function geodir_my_new_tab_content($tab_index) {
                if($tab_index =='testimonials_tab'){
                global $wpdb;
                $id = get_the_ID();
                $CustomerTestimonials = $wpdb->get_var("SELECT geodir_testimonials FROM wp_geodir_gd_place_detail WHERE post_id = $id ");
                echo $CustomerTestimonials;
                }
                if($tab_index =='service_area_tab'){
                global $wpdb;
                $id = get_the_ID();
                $ServiceArea = $wpdb->get_var("SELECT geodir_service_area FROM wp_geodir_gd_place_detail WHERE post_id = $id ");
                echo $ServiceArea;
                }
                if($tab_index =='post_profile'){
                global $wpdb;
                $id = get_the_ID();
                $DirectoryLogo = $wpdb->get_var("SELECT geodir_directory_listing_logo FROM wp_geodir_gd_place_detail WHERE post_id = $id ");
                if ($DirectoryLogo) {
                echo '<img src="';
                echo $DirectoryLogo;
                echo '"/>';}
                }   

    }

    #199219

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    have you tried this:

    geodir_before_description_on_listing_detail

    ?

    an example: https://wpgeodirectory.com/support/topic/tabs-in-single-view/

    Let us know,

    #199246

    EH
    Expired Member
    Post count: 96

    Oh my gosh this helped so much! Thank you! I really didn’t think there was going to be a way to do what they were asking. Here is my function, hopefully it will help someone else in the future.

    
    
            add_action ('geodir_before_description_on_listing_detail', 'geodir_my_new_tab_logo' );
                function geodir_my_new_tab_logo() {
                    global $wpdb;
                    $id = get_the_ID();
                    $DirectoryLogo = $wpdb->get_var("SELECT geodir_directory_listing_logo FROM wp_geodir_gd_place_detail WHERE post_id = $id ");
                    if ($DirectoryLogo) {
                        echo '<img src="';
                        echo $DirectoryLogo;
                        echo '"/>';} 
             }
    #199247

    Paolo
    Site Admin
    Post count: 31206

    Thanks for sharing your exmaples as usual! 🙂

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

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

Open Support Ticket