Custom Widget?

This topic contains 8 replies, has 2 voices, and was last updated by  Guust 7 years, 2 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #394547

    Joy
    Buyer
    Post count: 1076

    Hello, how would I create a custom widget? I want to use the same layout of the popular category widget but replace the links. Could you provide a little bit of guidance to get me started? Thank you.

    #394551

    Guust
    Moderator
    Post count: 29970

    Sounds like you just need to use a text widget and add the links in there.
    Let us know.

    #394553

    Joy
    Buyer
    Post count: 1076

    But how would I replicate the layout and styling? That’s where I’m a bit stuck on. Can I somehow hook into the styling or would I need to just create it from css?

    #394557

    Guust
    Moderator
    Post count: 29970

    Look at the code for the widget and copy.

    For example this is where you would copy the code from this page
    https://wpgeo.directory/supreme-directory/location/
    See the source at view-source:https://wpgeo.directory/supreme-directory/location/

    Then you can find the code starting as highlighted in the image, so it will use all the same styling.
    Replace and adjust as required.

    Thanks

    #394687

    Joy
    Buyer
    Post count: 1076

    Hi again Guust.

    So I have copied/pasted. I didn’t realize that it was that easy! But I don’t get any styling, will I have to create my own?

    Also, I have a question that’s a bit more complicated in relation to this project of mine. Here’s the problem:

    When someone allows geolocation, if they happen to navigate back to the homepage, they are presented with categories that reflect site-wide listings. Because of this, just on the home page, I would like to show this new widget, that I am trying to make, to reflect location buttons instead of the categories widget. So if someone navigates back to the home page, they can easily regain their location. It’s also easier than having to re-do the location switcher. My hope is to make things as user friendly as possible.

    Can this be achieved? Page with be shared in the next post. Thank you.

    #394688

    Joy
    Buyer
    Post count: 1076
    This reply has been marked as private.
    #394736

    Guust
    Moderator
    Post count: 29970

    To keep users “locked” into their location, when going to the homepage, change this setting:
    GD > Multilocations > Location Settings tab > Home page should go to > Current location page (ex: mysite.com/location/glasgow/)
    I changed it for you.
    See also https://wpgeodirectory.com/docs/multilocations/#location

    Anything else is outside support. Thanks

    #394737

    Joy
    Buyer
    Post count: 1076

    Somehow I didn’t see that attachment from the earlier post.

    BUT, this is such awesome news! I didn’t realize that this was a function. Perfect! Thank you.

    #394745

    Guust
    Moderator
    Post count: 29970

    That is because I only just realized I had not added the image that I prepared 🙂

Viewing 9 posts - 1 through 9 (of 9 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