Oxygen - Advanced Custom Fields Repeater sub-fields - link fields

WordPress Repeater link fields: For testing purposes I have defined one link as an Array and the second link as URL. When adding the repeater to a template the output of one link is an Array and the other link is displayed as URL instead of the actual "link text". The link also doesn't open link in new tab as defined.

What's wrong with this setup? See attachments

enter image description here

enter image description here

enter image description here

Solutions

Working solution to the problem described above:

It is important to know that my issue with ACF and Repeater is related to the Wordpress Oxygen builder.

In order to get get link fields with target blank you need to do the following:

  • CPT UI > create post type (set has Archive = true)
  • Custom Fields > Add field type Repeater, add sub-fields = field type set to text
  • Posts > Add Rows with link custom fields
  • Create Template > Add repeater to page, add text link module, set data to appropriate Field Name
  • Define link target : Add JS code block and add the following code

    jQuery('a').each(function() { var a = new RegExp('/' + window.location.host + '/'); if (!a.test(this.href)) { jQuery(this).attr("target","_blank"); } });

Similar questions

Advanced Custom Fields display last three sub-repeater rows
I am using Advanced Custom Fields (ACF) to pull repeater information from an events page and displaying a shortened list of the events on the home page. I have set up a repeater to allow the user to input which month the event will take place in(Allowing them to put in multiple months of events), then a sub-repeater to allow them to add multiple ev...
WP: Advanced Custom Fields. Flexible Content + Repeater Fields. Using Custom fields in inline CSS
I am trying to style a H4 element with a left and bottom border of varying widths and a specific colour which is defined by a custom field that the client would fill in the CMS. My CMS layout is correct but the code below I know not to be. My problem area is specifically with the H4, the other parts of the code are rendering correctly. The resultin...
How to create single-custom.php for different repeater fields (using Advanced Custom Fields) in Wordpress
I'm using Advanced Custom Fields Pro with Wordpress 4.1.1 I feel like this should be pretty easy but I've been struggling with it. The example I'll start with is I have a "Team" page that has a repeater with: All as sub_field I have everything working nicely in the page where all posts are display (the actual Team landing page) but I can't figure o...
How to create Repeater fields using Advanced Custom Fields?
I'm using Advanced Custom Fields and trying to create a field with the field type Repeater. But the problem is that the Repeater option doesn't appear in the select list with the field types. I can't figure out what's wrong. I'm using Advanced custom fields v3.5.3 and Wordpress 3.4.2. What could be the issue?
advanced custom fields - insert post programmatically and update repeater fields
I've an issue with the plugin "Advanced Custom Fields". The steps that I follows are: 1. Create post programmatically 2. Update all the repeater fields associated to the "post_type" The issue is at the point 2, infact when I create a post with Wordpress' interface (with a button) and i insert manually the id of that post in my code, it works perfec...
Advanced Custom Fields Repeater Fields Bootstrap tabs
I'm trying to integrate Bootstrap Tabs with ACF. But how should I pull data when I create more than one tab? When I use a tab at this time I can pull in this way but when I use more than one, how should I do? How do I create a loop to use multiple tabs? How to pull Tab links and content? Front-end Codes <!-- tab start --> &...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .