Function to display the place website URL instead of the word “website”

This topic contains 5 replies, has 3 voices, and was last updated by  Alex Rollin 4 years, 7 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #513620

    Suzi Berman
    Expired Member
    Post count: 17

    I found this snippet here: https://wpgeodirectory.com/support/topic/display-url-instead-of-text-for-fb-instagram-etc/#post-400634

    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;}
    }

    What file name do I place this into? Where inside the code of that file do I place this?

    #513633

    Kor
    Moderator
    Post count: 16516

    Hi Suzi Berman,

    Thanks for your post. Kindly insert it into the “Code Snippets Plugin” and see if it helps. https://wordpress.org/plugins/code-snippets/

    #513724

    Suzi Berman
    Expired Member
    Post count: 17

    Hello: I installed the plugin and added the snippet, selecting “Run snippet everywhere”. It did not change the website to the URL instead of displaying the word “website”. Can you advise on another solution? Can I change the snippet directly in the code instead of using the plugin? What file? Where in the code?

    #513728

    Suzi Berman
    Expired Member
    Post count: 17

    Hello: I stand corrected. I used the 2nd snippet

    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;}
    }

    And it worked!!! Thank you!

    #513803

    Alex Rollin
    Moderator
    Post count: 27815

    Wonderful!

    Also added to our docs: https://wpgeodirectory.com/docs-v2/places/custom/#url

    #513804

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
Viewing 6 posts - 1 through 6 (of 6 total)

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

Open Support Ticket