wp am4 error messages

Discussion in 'aMember Pro v.4' started by lifemedia, Dec 15, 2012.

  1. lifemedia

    lifemedia aMember Pro Customer

    Joined:
    Feb 3, 2010
    Messages:
    31
    Hi,

    How can I do a login link in wordpress amember error pages. I tried like %login and it didn't work.

    I am talking about on this page: http://www.amember.com/docs/Creating_Error_Messages

    Finally, i endup with a JS solution, but still wanted to know, if its possible:


    <script type="text/javascript">
    function wp_am4_redirect(){
    var currentURL = document.URL;
    window.location.href="http://somedomain.com/amember/login?amember_redirect_url="+encodeURIComponent(currentURL)
    }
    </script>

    Please <a href="javascript:wp_am4_redirect()">login</a> or register for <a href="http://somedomain.com/amember/signup/">Free Membership</a> to view this content.

    Now, i need to copy paste to all the error templates.

    Please do let me know, if there's any other better way of doing it.

    Thank you!
  2. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641
    You are making this way too complicated. You can do this with simple HTML.

    Assuming aMember is installed in the amember directory:
    Code:
    http://yoursite.com/amember/login
  3. lifemedia

    lifemedia aMember Pro Customer

    Joined:
    Feb 3, 2010
    Messages:
    31
    Thank you for your response!

    Oops .. I missed to mention, the reason is I need to redirect back to the same post after they login and so I am passing the amredirect_url value via JS.

    If its just the login page, then no problem, I can just use the login link directly.

    Thank you!
  4. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641

Share This Page