You can write some custom CSS and hook into the admin header.
http://www.advancedcustomfields.com/resources/actions/acfinputadmin_head/
An option to disable a normal text field would be just fine! Thanks mate
Mike
Perhaps it might bloat the repeater js a bit too much?
Elliot has stated that he would like to get through some version to improve the core functionality before there’s some UI/UX improvement, so maybe in the future we might see this.
As for now, please just that plugin mentioned above. It’s wonderful.
Cheers
Hi @jwight1234
Have you taken a look at this plugin?
http://wordpress.org/plugins/advanced-custom-field-repeater-collapser/
Have you taken a look at this plugin?
http://wordpress.org/plugins/advanced-custom-field-repeater-collapser/
Oh, that Settings API! Yes, that would be an interesting implementation.
I’m actually not using FontAwesome. I looked into it and it’s great, but I ultimately went with Icomoon
I’m actually having trouble with the plugin inside repeater fields, flex-fields, and two to a page. Perhaps you can take a look? http://support.advancedcustomfields.com/forums/topic/jquery-conflict-with-repeater-flex-fields-creating-own-field-type/
In response to your first request, I just created a Icon Library field that should be out in a day or two after I finish debugging it.
What do you mean by a Setting’s API? Can you elaborate a bit more on this? I’m interested in seeing what you mean by that.
As for the other fields, you could create your own field or extend some of the fields already created, have you taken a look at creating your own field type in the documentation? http://www.advancedcustomfields.com/resources/tutorials/creating-a-new-field-type/
EDIT: I figured it out!
Ah! you need to pass the ‘options’ parameter! code below should work.
<?php while(has_sub_field('top_links' , 'options')): ?>
<li>
<a href="<?php the_sub_field( 'link_url'); ?>" target="_blank">
<img src="<?php $image = get_sub_field('link_image'); echo $image['url'] ?>" alt="<?php the_sub_field('link_name') ?>">
</a>
</li>
<?php endwhile ?>
edit: updated the code to add the alt tag (using the link_name sub field)
Can you post a screenshot of your field group? that way I can help you debug this much faster!
Where are you trying to add this repeater field markup? are you within the WP loop? if so, maybe you need to pass the page_id parameter.
Thanks for fixing the original post, layout was going crazy
please edit your first response and delete the code. i believe it’s causing this thread’s layout to break.
If you image’s return value is on “Image Object”, you can grab the full size easily. Look at the code below:
<?php while(has_sub_field('top_links')): ?>
<li>
<a href="<?php the_sub_field( 'link_url'); ?>" target="_blank">
<img src="<?php $image = get_sub_field('link_image'); echo $image['url'] ?>">
</a>
</li>
<?php endwhile ?>
You should use has_sub_field() instead of the_repeater_field()
Ah, got it. Using the Repeater field or the Gallery field would be much easier to accomplish this.
To accomplish what you want to accomplish, you would have to use the
get_field_object() function.
Let’s start off dumping everything and seeing what we are working with:
<code>
<pre><?php $fields = get_field_objects(); var_dump( $fields ); ?>
</pre>
</code>
That will spit out the multi-dimentional array, in which you can just loop through it and get the data you need! You will need to do this within the WP loop, btw.
Note: The return value for my image fields are set as image objects.
<?php $fields = get_field_objects(); ?>
<?php if( $fields ): ?>
<?php foreach( $fields as $field ): ?>
<div><img src="<?php echo $field['value']["url"]; ?>" alt=""></div>
<?php endforeach; ?>
<?php endif; ?>
I think you’re making things a little more confusing than they are. Lets try simplifying the logic a bit.
Post a screenshot of the actual custom fields inside the field group, please. That way we can get the correct field names.
Start off by checking with a simple conditional if the current page_id is equal to your field.
for example:
<?php $field = get_field('your_field_name') ?>
<?php if(get_the_ID() == $field): ?>
First off, have you read the documentation on image fields?
http://www.advancedcustomfields.com/resources/field-types/image/
Post a screenshot of your fields in their field group
Hi @o3odesigns
Use the get_field() function, instead of the_field() function to store it as a variable. Look at the example below:
<?php $colourHoy = get_field('colour_pagina'); ?>
Hi @ab_mannan
I’m a little confused as to what you’re trying to accomplish.
Correct me if I’m wrong:
You have a multi-select field assigned to the custom post type named “Products”. Inside that multi-select field, there are numbers that correspond to page_id’s. What you want to do is display the products (that have that page_id assigned to it) when you are on that page,
For example: When on (viewing) page_id=10, display all the products that have page_id=10 assigned to it.
Is that what you’re trying to accomplish? Posting screenshots of your fields that correspond to this would actually help as well.
I’m assuming you are doing this within the loop and you don’t have to set up postdata. With that said, since you have a post object field inside a repeater, you dont have to use the foreach loop.
<?php while(has_sub_field('post_links')): ?>
<?php $post_objects = get_sub_field('items'); ?>
<ul>
<li>
<a href="<?php echo get_permalink($post_objects->ID); ?>"><?php echo get_the_title($post_objects->ID); ?></a>
</li>
</ul>
<?php endwhile; ?>
Works fine with repeater inside a flex field as well. Make sure you are running this code within the WP loop or a custom loop.
code within loop:
<?php while(has_sub_field('nested')): ?>
<?php $path = TEMPLATEPATH . '/included_file.php'; ?>
<?php if (file_exists($path)) {
include($path);
} ?>
<?php endwhile; ?>
include_file.php
<?php if(get_row_layout() == "heading"): //another field ?>
<?php the_sub_field('heading') ?><br>
<?php elseif(get_row_layout() == "repeater"): // repeater ?>
<?php while(has_sub_field('repeater')): ?>
- <?php the_sub_field('name') ?><br>
<?php endwhile ?>
<?php endif; ?>
Indeed i’m using nested repeaters, I will try using a flex field.
I just tested your method, and I can confirm it’s working fine;
One thing I did notice is that you should have added a / before ‘included_file.php’ in your path variable. I added it below!
Code within my loop:
<?php while(has_sub_field('nested')): ?>
<?php $path = TEMPLATEPATH . '/included_file.php'; ?>
<?php if (file_exists($path)) {
include($path);
} ?>
<?php endwhile; ?>
include_file.php code
<?php the_sub_field('name') ?> (<strong>
<?php while(has_sub_field('list')): ?>
<?php the_sub_field('list_name') ?>
<?php endwhile; ?>
</strong>)
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.