This topic has 1 reply, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #173722
     danicotillas
    Participant

    Hi,

    I would like to know how to create a dynamic link to the profile of the person connected in a button.

    It ask the URL and the code ##profile_link##profile doesn´t work.

    Is this possible?

     

    Thanks in advance

    #173785
     Laura
    Moderator

    Hello, you could use it in a widget by enabling php for widgets adding this to function.php of child theme

    COPY CODE
    
    add_filter('widget_text','execute_php',100);
    function execute_php($html){
         if(strpos($html,"<"."?php")!==false){
              ob_start();
              eval("?".">".$html);
              $html=ob_get_contents();
              ob_end_clean();
         }
         return $html;
    }
    

    And at the widget add this (you can add it inside of the button shortcode where it asks for the url )

    COPY CODE
    
    <a>">Profile</a>
    

    If the button shortcode alreay has the “<a” just copy

    COPY CODE
    
    <?php echo bp_loggedin_user_domain(); ?>
    

    Inside the href=” – “

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

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

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?