Display URL instead of text for FB, Instagram etc

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

  • Author
    Posts
  • #400546

    Timothy Sullivan
    Expired Member
    Post count: 63

    HI,
    I found this function to display the place website URL instead of the word “website” on the details page.

    add_filter( 'geodir_custom_field_website_name', 'geodir_change_website_field_display_name', 10, 3 ); 
    function geodir_change_website_field_display_name($name,$website,$post_id){
    if($name=='Website'){return $website ; }
    else{return $name;}
    }
    

    I would like to do the same for Facebook, Instagram, twitter and youtube. Is there a way to do this with a similar function? see attached screenshot for an example

    Attachments:
    #400581

    Guust
    Moderator
    Post count: 29970

    I’ll get a developer to have a closer look for you.
    Thanks

    #400616

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    You can make a feature request for this here: https://wpgeodirectory.com/requests/

    We will look at this for future versions.

    #400634

    Stiofan O’Connor
    Site Admin
    Post count: 22954

    This should do it:

    add_filter( 'geodir_custom_field_website_name', 'geodir_change_website_field_display_name', 10, 3 ); 
    function geodir_change_website_field_display_name($name,$website,$post_id){
    if($name=='Facebook' || $name=='Twitter' || $name=='Instagram' || $name=='Website'){return $website ; }
    else{return $name;}
    }

    Thanks,

    Stiofan

    #400668

    Timothy Sullivan
    Expired Member
    Post count: 63

    Thank You Stiofan, that works perfectly.

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

The topic ‘Display URL instead of text for FB, Instagram etc’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.