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
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...
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