• Resolved jgateman

    (@jgateman)


    Simply amazing plugin! For the first time ever I have donated to a plugin author as this is the best one I have ever seen. Great work.

    I have a problem I am trying to solve and I have spent a number of hours trying to solve it but I can only get the word “Array” to show up at best.

    We have a repeater field setup in our post called “program_day”. Inside that are rows with repeaters inside them. Each row is called “exercise” with sub-fields “exercise_name” and “exercise_post_id”.

    What I am trying to do is display each exercise in it’s own container with the exercise_name as a url to that specific post id.

    I have printed the repeater field data on the page and have pasted it below but do not understand how to pull a specific “exercise” row and display the “exercise_name” as a clickable link to the “exercise_post_id”

    I’ve tried countless combinations of the short codes but can only get “array” to show up. Any help would be greatly appreciated!

    Thank you.

    Array
    (
    [key] => field_54d2b9707e696
    [label] => Program Days
    [name] => program_day
    [_name] => program_day
    [type] => repeater
    [order_no] => 0
    [instructions] =>
    [required] => 0
    [id] => acf-field-program_day
    [class] => repeater
    [conditional_logic] => Array
    (
    [status] => 0
    [rules] => Array
    (
    [0] => Array
    (
    [field] => null
    [operator] => ==
    )

    )

    [allorany] => all
    )

    [sub_fields] => Array
    (
    [0] => Array
    (
    [key] => field_54d2b9937e697
    [label] => Day’s Exercise
    [name] => exercise
    [_name] => exercise
    [type] => repeater
    [order_no] => 0
    [instructions] =>
    [required] => 0
    [id] => acf-field-exercise
    [class] => repeater
    [conditional_logic] => Array
    (
    [status] => 0
    [rules] => Array
    (
    [0] => Array
    (
    [field] => null
    [operator] => ==
    )

    )

    [allorany] => all
    )

    [column_width] =>
    [sub_fields] => Array
    (
    [0] => Array
    (
    [key] => field_54d2ba307e698
    [label] => Name
    [name] => exercise_name
    [_name] => exercise_name
    [type] => text
    [order_no] => 0
    [instructions] =>
    [required] => 0
    [id] => acf-field-exercise_name
    [class] => text
    [conditional_logic] => Array
    (
    [status] => 0
    [rules] => Array
    (
    [0] => Array
    (
    [field] => null
    [operator] => ==
    )

    )

    [allorany] => all
    )

    [column_width] =>
    [default_value] =>
    [placeholder] =>
    [prepend] =>
    [append] =>
    [formatting] => none
    [maxlength] => 18
    )

    [1] => Array
    (
    [key] => field_54d2ba937e699
    [label] => Exercise Post ID
    [name] => exercise_post_id
    [_name] => exercise_post_id
    [type] => number
    [order_no] => 1
    [instructions] =>
    [required] => 0
    [id] => acf-field-exercise_post_id
    [class] => number
    [conditional_logic] => Array
    (
    [status] => 0
    [rules] => Array
    (
    [0] => Array
    (
    [field] => null
    [operator] => ==
    )

    )

    [allorany] => all
    )

    [column_width] =>
    [default_value] =>
    [placeholder] =>
    [prepend] =>
    [append] =>
    [min] =>
    [max] =>
    [step] =>
    )

    )

    [row_min] =>
    [row_limit] =>
    [layout] => row
    [button_label] => Add Exercise
    )

    )

    [row_min] =>
    [row_limit] =>
    [layout] => row
    [button_label] => Add Day
    [field_group] => 292
    [value] => Array
    (
    [0] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.25
    [exercise_post_id] => 832
    )

    )

    )

    [1] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [2] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.26
    [exercise_post_id] => 833
    )

    )

    )

    [3] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [4] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.27
    [exercise_post_id] => 834
    )

    )

    )

    [5] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [6] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [7] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.28
    [exercise_post_id] => 835
    )

    )

    )

    [8] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [9] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.29
    [exercise_post_id] => 836
    )

    )

    )

    [10] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [11] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.30
    [exercise_post_id] => 837
    )

    )

    )

    [12] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [13] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [14] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.31
    [exercise_post_id] => 838
    )

    )

    )

    [15] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [16] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.32
    [exercise_post_id] => 839
    )

    )

    )

    [17] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [18] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.33
    [exercise_post_id] => 840
    )

    )

    )

    [19] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [20] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [21] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.34
    [exercise_post_id] => 841
    )

    )

    )

    [22] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [23] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.35
    [exercise_post_id] => 842
    )

    )

    )

    [24] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [25] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Tornado Abs Ep.36
    [exercise_post_id] => 843
    )

    )

    )

    [26] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    [27] => Array
    (
    [exercise] => Array
    (
    [0] => Array
    (
    [exercise_name] => Off
    [exercise_post_id] => 0
    )

    )

    )

    )

    )

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jgateman

    (@jgateman)

    Got it figured out!

    [repeater field=”program_day” num=”26″]
    [-repeater field=”exercise”]
    a href=”index.php?p=[field exercise_post_id]”>[field exercise_name]
    [/-repeater]
    [/repeater]

    This does exactly what I need. Took out the tags on the link to display it above. What a great plugin. Please keep on supporting this gem!

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello, thank you so much for the donation. I’m glad the plugin has been useful for you. I use it on almost all websites I build, so I’m sure I’ll keep maintaining it. šŸ™‚

    I see, the field you were trying to display was a repeater inside a repeater. That’s a tough one, it’s great you were able to figure it out.

    Also, I love the beautiful airbrush and photography work on your site. So nice!

    Thread Starter jgateman

    (@jgateman)

    Thank you very much!

    I am sure I will have other questions in the future as I get to see what this plugin can do. Since I don’t understand php very well, this makes it much easier now for me to build complex website functionality.

    All the best!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘ACF Repeater Fields’ is closed to new replies.