WordPress.org

Ready to get started?Download WordPress

Forums

Link refering to random external adress (25 posts)

  1. kevenc
    Member
    Posted 1 year ago #

    Hi,
    I'm trying to find a way or a plugin that allow me to put a link that will refer to random external link.

    for example, i want to put a button in a page that will refer to a different external website everytime based on a list that i can update.

    You know something that can help me do that?

    thanks in advance.

    Keven

  2. Marventus
    Member
    Posted 1 year ago #

    Hi!
    I have a few doubts about what you are trying to do:
    1. Does the link text need to change as well as the actual link? Meaning, would a "Click here" text suffice or would it have to changed based on what site the link is taking you?
    2. Do you need this on the backend (WP admin) or frontend?
    3. Where would the button appear: pages, posts, home, all of the above, etc.?
    If you provide me with that information, I can definitely help you implement it.
    Cheers!

  3. kevenc
    Member
    Posted 1 year ago #

    Hi,
    The link text doesn't need to change. In fact, i was thinking of a button that refer to a different address every time someone click on it. Can be an image of a dynamic button.

    I would love to have it on accessible by wp-admin but i'm open to other solution. I would need to change the link list often adding entry and that.

    I would like the button to appear at some specific place but i would place that in a sidebar the majority of the time.

    Just for you to better understand my needs, i will make a website for a team and i want a link to go to a different member store each time someone click on the button to distribute the volume.

    Happy that you can help me. :-)

  4. Marventus
    Member
    Posted 1 year ago #

    Yeah, no pb. I'll write you a little plugin. What's the name of your site?

  5. kevenc
    Member
    Posted 1 year ago #

    Wow, thank you very much. Didn't though someone will give me a good solution like that. The name is Équipe Visalus Rimouski. We live in Quebec so my website will be in french.

    Just to add to that, i would need to have two random button that refer to 2 different list but that work exactly the same.

    Thanks again

  6. Marventus
    Member
    Posted 1 year ago #

    Hi kevenc,

    I just finished writing the plugin I promised you. It is fresh out of the oven so it's not on the repository yet, but you can download it from here.
    I'll post some instructions about how to use it in a while.

    Cheers!

  7. Marventus
    Member
    Posted 1 year ago #

    1. WHAT THIS PLUGIN DOES:

    EVR Random Links allows you to create a list of URLs and to randomly display links to any number of them in your posts, pages, and widgets.

    2. HOW TO USE:

    a. After activating the plugin, go to the plugin settings and create/paste links inside the text area one line at a time. You can load the link examples to see how you should do it.

    b. You don't have to fill in the other settings since they will get populated automatically with the default values if left empty. However, you can also customize these at will.

    c. To display the links on your site, you have to paste the plugin's shortcode handle inside your page, post, or text widget of choice:

    [evr-random-links]

    That shortcode will be replaced automatically by the necessary code to display the links.
    The shortcode also takes parameters which, if provided, will override the default settings set in the plugin's option page. These parameters are:
    text --> the link text to display
    number --> the number of links to generate

    Example:

    [evr-random-links text="Click here" number="1"]

    The code above will display one link with the text "click here".

    d. IMPORTANT: If either:
    i. The link list on the plugin settings is empty,
    ii. The link list is broken or not inputted correctly, OR
    iii. The "number of links to display" option exceeds the number of links on your list
    The plugin will throw an error and let you know what the problem is.

    3. ADDITIONAL CUSTOMIZATION:
    You can customize the look and feel of the links by tweaking the frontend stylesheet that is added to your site automatically when the plugin is active. The stylesheet in question is called style.css and it is located inside evr-random-links/css.

  8. Marventus
    Member
    Posted 1 year ago #

    New temp link to the plugin.

  9. kevenc
    Member
    Posted 1 year ago #

    a very big thank you for that, i'll check it and let you know.

  10. kevenc
    Member
    Posted 1 year ago #

    hi, just installed it but i cannot find how the random work. It seems to always point to the first link i've put in the list and no random. I tried on a few browser just to make sure and i didn't found how to make it work.

    Am i doing something wrong?

    Thanks again for all your help.

  11. Marventus
    Member
    Posted 1 year ago #

    Hi Kevenc,
    I just checked and you are right: when the number of links to show is smaller than the amount of URLs on the list, only the first x number are shown randomly instead of showing links from the entire list.
    Let me work on it and get back to you.

  12. kevenc
    Member
    Posted 1 year ago #

    hi Marventus,
    Just to add to that, is that possible to have the possibility to duplicate and have more than one random list?

    Also, i would like to add it as a button link. I have shortcode in my site for that but i don't know how to make it.

    Thanks again.

  13. Marventus
    Member
    Posted 1 year ago #

    One of the features of the plugin is that you can add as many lists as you like through the shortcode, one shortcode instance per list.
    About the button links, what exactly do you mean by that? You can style the links using CSS styles as suggested in 3. Additional Customization. If that's not what you mean, could you share a link to any page of your site where you are using the desired button links?

  14. kevenc
    Member
    Posted 1 year ago #

    Where am i able to add a new list? I only have one and don't see a way to add a new one.

    For the button, i'll do it with the CSS then. Thanks.

  15. Marventus
    Member
    Posted 1 year ago #

    To add a new list, you would just insert the shortcode again. For instance:

    [evr-random-links text="Click here" number="2"]
    [evr-random-links text="Link" number="4"]

    Should output two link lists:
    1. One list with two links with the text Click here
    2. The other list with four links with the text Link.
    You can add lists to your widgets as well as your template files, pages, and posts.
    Let me look into the random issue and get back to you.
    Cheers!

  16. kevenc
    Member
    Posted 1 year ago #

    Yes but if i do that i only refer to the same list.

    Also, the number define the number of link that will be showed but what i would like is to always have only one link that refer to different link on the page for every customer that come on the page.

    For example,
    Customer 1 come to one page. I've inserted the link on the sidebar. The customer click on the link, he goes to the first link on the list.
    Customer 2 come to the same page or on another one and click on the same link, the customer is redirected on the second on the list.
    And so on.

    That would be great also to open in a new window and keeping the actual site open.

  17. kevenc
    Member
    Posted 1 year ago #

    here an example of what i would like on that example page i did : http://www.visalus.kevencote.com/contactez-nous/ You see those two button on left, when customer 1 click on commandez, they are redirected to the first on the link list. When customer 2 click on commandez, they are redirected on the second and so on.

    when customer 1 click on Devenez promoteur, they are redirected to the first on a completely different link list than the other button. When customer 2 click on Devenez promoteur, they are redirected on the second link of the second list and so on.

    Just want to say thank you again for your help. Hope this explanation will help.

  18. kevenc
    Member
    Posted 1 year ago #

    sorry, i change the url in the mean time. The new url is http://www.visalusrimouski.com/contactez-nous/

  19. Marventus
    Member
    Posted 1 year ago #

    No pb.
    Still customizing it according to your latest comments.
    I'll let you know as soon as it's ready.
    Cheers!

  20. Marventus
    Member
    Posted 1 year ago #

    Hi.
    Version 0.2 is ready and up for downloading (same link as here). I figured out the issue with random links and I added a new parameter to the shortcode called lists. Accepted values are 1 or 2 (since there are only two link lists).
    For instance,

    [evr-random-links text="Click here" number="2" lists="2"]

    would generate two links with the link text Click here and pointing to URLs on List 2.

    Let me know if I nailed it this time.

  21. kevenc
    Member
    Posted 1 year ago #

    big thank again. I check that and let you know

  22. kevenc
    Member
    Posted 1 year ago #

    Hi,
    Just tested it and it work well. A really big thank you about that. When i posted this, i never though i would get a plugin like that.

    Thanks a bunch

    Now i need to find a way for it to appear as a button like in this page http://www.visalusrimouski.com/contactez-nous/ but this should be easier to find.

  23. Marventus
    Member
    Posted 1 year ago #

    No pb! I thought this could benefit other users as well if it was made into a plugin. I'm planning on submitting it to the repository under the name WP Superb Links and expanding it as time and work permits. I'll post a link to the plugin once it's available on the Repo.
    BTW, I didn't incorporate your request of forcing the links to open up in a new window because I'd like to add that as an option and didn't have that much time to work on it.
    If you'd like a button feel to your links, you should definitely try CSS gradients combined with borders (for depth). There's a pretty cool cross-browser compatible gradient generator I use very often called Ultimate CSS Gradient Generator.
    Good luck with your site!

  24. reuborg
    Member
    Posted 1 year ago #

    Can the text displayed be unique for each link?

  25. Marventus
    Member
    Posted 1 year ago #

    Hi reuborg.
    The way it is configured for the moment is that it displays the same text for all links.

Topic Closed

This topic has been closed to new replies.

About this Topic