• bestitsol

    (@zeeshan4157)


    unable to get the data from repeater fields follow every steps as shown in the images instruction ,i made the Advanced Content Type (project_image) and create two fields for repeater
    1.project_image
    2.position

    and add this in custom post type (project),
    i added the field Pods Table As Repeater Field (projects_box) and choosed in additional field option project_image, everything is working fine but unable to fetch these fields data at frondend.
    kindly help me with this.
    Regards,
    Zeeshan

    • This topic was modified 7 years ago by bestitsol.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Coding Panda

    (@codingpanda)

    -_-! I can help you, but you could add a ticket to the Support forum instead of giving me a One Star here. It is very frustrating to see a One Star.

    There some tutorials about how to pull data out at the frontend in the FAQs section. https://www.ads-software.com/plugins/panda-pods-repeater-field/#description

    Based on what you described, just in your single-project.php template, use pods_field( ‘projects_box’ ) to fetch the data. I recreated your repeater field and pulled the data out here: https://217.199.187.74/zhenghe-migration.co.uk/project/first-project/

    As you can see “position” returned “left” and “right” (I used a Simple Relationship field), and “project_image” return an image ID. You can use wp_get_attachment_image_src() to get your image with the image ID. https://developer.www.ads-software.com/reference/functions/wp_get_attachment_image_src/

    ———-code————
    $proejcts_arr = pods_field( ‘projects_box’ ) ;

    foreach( $proejcts_arr as $project_arr ){
    $img_arr = wp_get_attachment_image_src( $project_arr[‘project_image’] );
    $img_url = ”;
    if( $img_arr ){
    $img_url = ‘' . esc_attr( $project_arr['name'] ) . '‘;
    }
    echo ‘<p style=”clear:both”>Position ‘ . esc_html( $project_arr[‘position’] ) . $img_url . ‘</p>’;
    }

    Any problems, just let me know.

    Plugin Author Coding Panda

    (@codingpanda)

    Thank you very much, Zeeshan. ^_^

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue’ is closed to new replies.