Extra Field outside of Tabs

This topic contains 4 replies, has 2 voices, and was last updated by  Simone 10 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #37291

    scabrera
    Buyer
    Post count: 13

    Hi I made an extrafield which contains an Image. Somebody knows how i can display it in the main content area, but not in a Tab?
    thanks

    #37294

    Simone
    Expired Member
    Post count: 3515

    Hello, you can add the following code in your functions.php (inside your child theme’s folder)

    
    
    add_action( 'geodir_details_main_content', 'my_custom', 45 );
    function my_custom() {
    global $post; 
    global $wp_query;
    
    $postid = $wp_query->post->ID;
    
    	
    	$customfield= geodir_get_post_meta($postid,'geodir_customfield',true); 
    	
    		
    	
    	echo '<p class="clearfix"> '.$customfield.'</p>';
    	
    }

    change this to whatever is the name of your custom field (HTML variable name) remember to append geodir_ first

    #37368

    scabrera
    Buyer
    Post count: 13

    Thanks but this gives me just the path of my image…

    #37373

    scabrera
    Buyer
    Post count: 13

    ok, got it.
    replaced the echo with: echo ‘<div class=”myclass”> </div>’;

    thank you

    #37398

    Simone
    Expired Member
    Post count: 3515

    yes that’ll be showing the raw output of the field, wrapping it into the proper tag will result in an image 🙂

    you’re welcome.

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
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount