Changing "Website" link anchor text to show full address

This topic contains 6 replies, has 3 voices, and was last updated by  Guust 8 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #48778

    brian
    Free User
    Post count: 20

    http://screencast.com/t/zyBAhP0gmH

    Hello! I would love to change the anchor text of my listing’s website from “Website” to “http://www.websitedomainname.com/”. Do you have any suggestions on how I may be able to do so?

    Thank you!
    – Brian

    #48795

    Guust
    Moderator
    Post count: 29970

    I know adding this to your child theme’s functions.php will link it to the Listing’s name, but not I am not sure how to make it return the full URL including the HTTP. I’ll alert Paolo to have a look too.

    
    
    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 get_the_title( $post_id ); }
    else{return $name;}
    }
    #48885

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    just change :

    get_the_title( $post_id )

    with

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

    Let us know how you went,

    Thanks

    #48906

    brian
    Free User
    Post count: 20

    Hi Paolo, Thanks! I’m not entirely sure where to put this change… Tried Ctrl+f to find the add_filter in functions.php in framework and child theme… Where can I make this change?

    #48907

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    sorry Brian, I thought you read that in Guust’s reply:

    “adding this to your child theme’s functions.php”

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

    Let us know.

    Thanks

    #50438

    brian
    Free User
    Post count: 20

    Cool cool, I was successful. Thanks Guust / paolo!

    #50446

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

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

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

Open Support Ticket