Home Forums Front-end Issues Link on Text Fields


Link on Text Fields

  • Hello,
    I dont know how to explain but hope you understand What i am trying to say.

    I create a custom field of text and on front-end its show me text Its fine but how I can make auto links like this

    Hope you understand.


  • You would need to supply this link, either in another field or in your code

      $text = get_field('text-feild-name');
      $link = 'some url'; // or code to get/set url
      echo '<a href="',$link,'">',$text,'</a>';
  • This thing will be manually, cant be automated? Means city will be clickable and when we click, it will take to you archive style page?

    Which you gave me, for better thing is CHECKBOX

  • Is there any code like wordpress have date system, links created automatically. I want auto system, means I dont want to add links manually.

  • Where is the link going to come from? This URL needs to either be entered somewhere like another field or it needs to be coded. Maybe you’re using the wrong type of field. If you want to have a link and be able to modify the link text used then this information will need to be entered. Maybe you want try a page link field or a link field But both of these will still need some coding.

  • I want auto system as like wordpress calendar. When we click on date then we got a page where we can see the posts. So we dont have to create all pages/post for dates. So is there any code for this, what ever we give text, it will create a auto link.

  • I guess it’s a little more intricate than just creating a simple text field. I’d suggest using categories or custom taxonomies to which you associate your posts/entries. You can then use the category link to get the list of posts associated to that category.

  • What @vipstephan says sounds like what you want. You need a custom post type and maybe a custom taxonomy or 2. I don’t think what you’re trying to do can be achieved with ACF alone.

  • Ok, Can we make this kind of thing with CHECKBOXES?

  • I did this on check-boxes and its working but for this I have to update every posts to add link. Why its not make hyperlink on check-boxes which I posted in posts.

    <a target="_blank" href="">Masters</a> : Masters
    <a target="_blank" href="">Graduation</a> : Graduation
    <a target="_blank" href="">Intermediate</a> : IntermediateD
Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Link on Text Fields’ is closed to new replies.