Modifying My Dashboard Widget

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

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

Open Support Ticket
  • Author
    Posts
  • #12726

    oldmankit
    Buyer
    Post count: 116

    I would like to edit the ‘My Dashboard’ Widget. I would like to:

    • add a shortcode to login with facebook
    • Change the link that says “New User? Register Now”. I want it to link to my own, custom registration page.

    I can think of two ways to do this. One is to do these edits to the widget. I can see a file called ‘geodirectory_widgets.php’ that I could edit to make the widget behave as I want. However, editing this file would surely cause headaches when the plugin is updated.

    The other option is to create a brand new widget from scratch. The only thing I wouldn’t know how to do would be to have the ‘favourite listings’ and ‘my listings’ functionality. I think these are useful features that I don’t want to miss.

    Is there a page that this plugin generates that I could link to which would display a user’s favourite listings / own listings?

    #12732

    Guust
    Moderator
    Post count: 29970

    To login with FaceBook, use this plugin:
    http://www.oneall.com/

    To change the text of “New User? Register Now”, use your translation file:
    http://docs.wpgeodirectory.com/translate-core/

    To change the URL of the login page, look at this article:
    http://docs.wpgeodirectory.com/redirecting-the-login-page/

    This might also be of interest:
    http://wordpress.org/plugins/sidebar-login/

    There is a page that lists your user’s favourites and listings.
    The dashboard widget will link to them if you add the links here:
    GD > design > navigation > User Dashboard Post Type Navigation Settings

    #13888

    oldmankit
    Buyer
    Post count: 116

    Thank you very much Guust for your helpful reply. Thanks to your help I have found the user favourites / listings page for my site. I can see that these pages are created with a link that contains the username.

    I hope to make my own sidebar dashboard from scratch. I can’t do that right away since I will need to find a way of getting the logged-in username to insert into the url, in order to get the favourites/listings page. I’m sure I will find a way to do that (with PHP I expect) so that I can build my very own custom user dashboard.

    In the meantime, I followed the instructions here: http://docs.wpgeodirectory.com/redirecting-the-login-page/

    This has worked for every link generated by my site except the user dashboard. The ‘New User? Register Now’ and ‘Forgot Password?’ links still point to the old locations (e.g. http://reikiconnect.org/?geodir_signup=true&page1=sign_up), not the new location (http://reikiconnect.org/account/).

    I can see how to translate the text ‘New User? Register Now’ and ‘Forgot Password?’, however, I don’t see a way to change the url that these links point to.

    FYI, the code that I used to redirect the login page is here:

    
    
    // Redirect the login page
    add_action('init' , 'geodir_redirect_to_default_login') ;
    function geodir_redirect_to_default_login()
    {
       if(isset( $_REQUEST['geodir_signup']))
       {
      wp_redirect(home_url().'/account/');
      exit();
       }
    }

    Thanks again.

    #13940

    Guust
    Moderator
    Post count: 29970

    Although the links “point” to the old URL, they will go or “redirect” to the new URL. At least when I try it?

    #14001

    Wayne Harvey
    Expired Member
    Post count: 102

    I also used the instructions at http://docs.wpgeodirectory.com/redirecting-the-login-page/ to redirect to a Theme My Login “login” page and it did not work. The link from the sidebar user dashboard widget continued to go to the GD login/sign up page. I’m using Divi and the Divi compatibility pack.

    #14003

    oldmankit
    Buyer
    Post count: 116

    Right you are. Thank you Guust!

    #14004

    oldmankit
    Buyer
    Post count: 116

    @Wayne One thing that I noticed when I made this change was that on the tutorial page http://docs.wpgeodirectory.com/redirecting-the-login-page/

    the apostrophes in the php code are of the curly quote (or angled) variety (I think unicode U+2018). This won’t work with php (at least when I pasted that code into my functions.php it had no effect).

    What you need to do is replace the curly quote with a straight quote (unicode U+0027). You could do a find and replace. If I haven’t explained that right then please just ask for clarification. When I made this change, the code worked.

    #14022

    Guust
    Moderator
    Post count: 29970

    Wayne, it should not matter what theme you use.
    If you want us to have a look, start a new topic, and post your WP admin details.

    @oldmankit, I checked the quotes and they seemed fine? But that could be indeed the trouble if not copying and pasting as basic code …

    #14077

    Wayne Harvey
    Expired Member
    Post count: 102

    Guust and oldmankit. Thanks for your help. The curly quote was indeed the issue. I put in straight quotes and all worked as expected.
    It seems that the one issue in this topic that remains is creating a dynamic link, ie. a link that includes the logged in user, that links to the “author”. I’m no developer but I continue to search for that answer as well. My goal is to have such a link to put into the very nice Theme My Login plugin’s custom profile page. Cheers.

    #14090

    Guust
    Moderator
    Post count: 29970

    Wayne, have a look here:
    https://wpgeodirectory.com/support/topic/creating-accounts/

    A better author page is on the drawing board …

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount