Skip Navigation

[Resolved] How to Display the filed value by including the link from another field.

This support ticket is created 4 years, 6 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1861571

Tell us what you are trying to do?
How to Display the filed value by including the link from another field.

For the new Articles we would like to show Event source as Text field name as : news_source and have that hyperlink with the another field as news_url

#1861733

Hello, I'm not quite clear what you want to achieve. It sounds like you have two custom post types - Articles and Events. You have two custom fields - news_source and news_url. I'm not clear which post type has these fields, can you clarify for me? Can you clarify how Articles and Events are related? Can you tell me more about where you want to display the hyperlink? If you'd like to share login credentials, I can take a look at your setup in wp-admin and give more direct guidance.

#1861741

Sorry for the confusion. We have 2 custom fields - news_source and news_url.

Want to Display in such a fashion so that News source (news_source field) will have the link for the News_url field.

For Example:

news_source = BBC
news_url= hidden link

#1861773

You can use some custom HTML and Types field shortcodes to construct custom link markup code. When displaying a post that contains the news_source field and the news_url field, the HTML markup will look like this:

<a href="[types field='news_url' output='raw'][/types]">[types field='news_source' output='raw'][/types]</a>

You can add that custom HTML in a custom HTML block if you're using the Block Editor to design your site content.

If you want to display this information in a related post instead of the post that contains the fields, I need to know more about how the two posts are related.

#1861791

It is showing like the below:

hidden link">New York Times][/types]

but it should just show the New York Times with the hyperlink.

#1861845

I can take a closer look if you provide login credentials. Please let me know where I can find the code you added, and I will give you some feedback.

Otherwise, please include some screenshots showing how you added the code in wp-admin.

#1861875
ToolSet_Screenshot.jpg

See the attached screenshot for the backend and frontend.

#1861921
Screen Shot 2020-11-30 at 2.07.10 PM.png

I'm not really able to tell from the screenshots how this code was added to your Block Editor design, but it looks like there was either a copy + paste error or the Block used to insert the code has been corrupted somehow. See my screenshot here. There is some extra code that should be removed, as indicated by the red rectangle. The correct code is shown again here for your reference:

<a href="[types field='news_url' output='raw'][/types]">[types field='news_source' output='raw'][/types]</a>

If you're still having trouble, I may need to take a look in wp-admin.