Skip Navigation

[Closed] links with same anchor text, but change link location based on custom url field

This support ticket is created 3 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 7 replies, has 2 voices.

Last updated by Jamal 3 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#2160371

I want to create a small list of custom url hyperlinks that will display on 2000+ custom posts.
The anchor text will be the SAME on all, but the url should come from a DYNAMIC source. In other words, the actual link url location the anchor text points to needs to change based on a custom field I set up.

I already tried using the URL custom field, but there is no where I can see to add anchor text. It just displays the long, ugly url text.

Also tried using code <> and html blocks to build the anchor text and link manually, inserting the custom url field in the correct portion of the html link code, but none of this is working for me.
What am I missing? This seems like it would be a simple task...

Here is an example page that shows what I am redesigning.
hidden link
The links right under the red heart that say 'Water Levels' and 'Nearby Lakes' and 'Weather Forecast' will be on 2000+ pages, all with the same anchor text, but the urls will change based on the data uploaded and applied to a custom field.

Can you please explain exactly which custom fields to use and how to display them like this in my content template?

#2160737

Hello and thank you for contacting Toolset support.

I can't really tell what to do before I understand better what you want to achieve. Can you give some concrete examples?

What do you mean by "The anchor text will be the SAME on all"? Can you give some examples?
What do you mean by "the url should come from a DYNAMIC source" ? Have you already created the custom fields or not? Can you give some examples?

#2160771

I did give you an example to look at. That link to the lakelubbers site is exactly what I am rebuilding.
hidden link

If you go to that page and look at the three links just under the h1 tag (below the small red heart) this is what I am trying to achieve. There are 2000+ pages just like this one, each detailing a different lake. Those three links will appear on all 2000+ pages and will appear the same as far as anchor text for 'Water Levels' 'Nearby Lakes' and 'Weather Forecast', but the urls will need to change.

**Lake Guntersville page**
hidden link
Water Levels (anchor text) ---> hidden link
Nearby Lakes (anchor text) ---> hidden link
Weather Forecast (anchor text) ---> hidden link

**Richland Chambers Lake page**
hidden link
Water Levels (anchor text) ---> hidden link
Nearby Lakes (anchor text) ---> hidden link
Weather Forecast (anchor text) ---> hidden link

Every page of this site will have those three links, but the urls will need to change based on my custom fields info for that lake ( lat/long coordinates and a custom url for site that tracks water levels)

What is the best way to achieve this with Toolset?

#2160781

dupe message

#2160783

I just want those links to look and behave the same way you see on these example pages.
I am not sure what type of custom field to use with Toolset so that I can eventually build the links in the post template.

I tried a URL custom field -- but that doesn't allow me to set the anchor text, just shows actual url
I tried manually building links in a code box with Water Levels but I can't get the links don't actually work

#2161141

Well, I got confused by your words, especially using anchor link which is what comes after the # in a URL. Those URLs do not include any anchor link #anchor-link-1. They include the URL parameters like "?attr=value&attr2=value2"

Anyway, if you want to build exactly the same links, you will need an address field(Using the Toolset Maps plugin), and a URL field or text field to store the site(I don't know if you must have a URL to a website or a site name like GUH from the first link Water levels).

I am sure you will understand, that I can't see the project the same way you do, without a detailed explanation. I work on different users' cases per day, and I can't just understand everything without clear explanations. That's why I asked for more details and more examples.

Anyway, I think that you can build these links with shortcodes. Something like:

<em><u>hidden link</u></em> field="site"][/types]&DataType=[types field="type"][/types]&submit=View+info

The Toolset user interface can help you to generate the shortcodes.

To make this appear on all the 2000 posts, you need to add this inside the post type content template.

If this is not enough clear, please allow me temporary access to your website and I'll prepare a link as an example for you. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Please tell me what fields you will be using, so I don't have to browse all the fields and guess which one? Also, tell me what post type you are working on? And if you can provide a direct URL each time, that would be great.

#2163147

Thank you Jamal. Thank you for your reply. It was not my intention to sound impatient, but I guess my frustration is showing through in my replies. Toolset has been a steep learning curve for me thus far and I'm continuing to try and improve.
I will work more at this and get back with you.

#2165513

Thank you for your feedback and my apologies for the late reply, but I do not work on Wednesdays and Thursdays as you may check on my profile page https://toolset.com/forums/users/jamal-b/

Let me set this ticket as waiting for your reply, which should keep it open for 2 weeks. You will receive the first reminder notification in one week.

The topic ‘[Closed] links with same anchor text, but change link location based on custom url field’ is closed to new replies.