Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • felix
    Member

    I corected the error …but the images don’t show up 🙁

    felix
    Member

    Thank you so much, i almost succeed but i can’t display the images (the url and caption is displaying fine). May you give me some tips.

    Here is my piklist code:

    <?php
    /*
    Title: Carousel
    Post Type: post
    Order: 1
    Collapse: false
    Tab: Add-More's
    Sub Tab: Single Level
    Flow: Demo Workflow
    */
    
    piklist('field', array(
        'type' => 'group'
        ,'field' => 'slides_basic'
        ,'add_more' => true
        ,'label' => __('Slide Images with Basic uploader', 'piklist-demo')
        ,'description' => __('This is the same field as above, except it is using the Basic uploader.', 'piklist-demo')
        ,'fields'  => array(
          array(
            'type' => 'file'
            ,'field' => 'image'
            ,'label' => __('Slides', 'piklist-demo')
            ,'columns' => 12
            ,'validate' => array(
              array(
                'type' => 'limit'
                ,'options' => array(
                  'min' => 1
                  ,'max' => 1
                )
              )
            )
          )
          ,array(
            'type' => 'text'
            ,'field' => 'url'
            ,'label' => __('URL', 'piklist-demo')
            ,'columns' => 12
          )
          ,array(
            'type' => 'text'
            ,'field' => 'caption'
            ,'label' => __('Caption', 'piklist-demo')
            ,'columns' => 12
          )
        )
      ));

    … and here is my display code:

    add_action('genesis_after_loop', 'qaz', 25);
    function qaz() {
        global $post;
            
            $carousel_builder = get_post_meta( get_the_ID(), 'slides_basic', true ); 
    
            foreach ( $carousel_builder as $carousel_build ) {
          
                echo '<p>' . $carousel_build['image'] . '</p>';
                
                foreach ($m_event as $event) {
                   list($key, $value) = explode(',',$event);
                   $indexed_events[$key] = $value;
                }
    
                $carousel_buildimg = $carousel_build['image'];
                    foreach ($image_ids as $image) {
                            $myupload = get_post($image); 
                            $title = $myupload->post_title;
                            $description = $myupload->post_content;
                            $caption = $myupload->post_excerpt;
                            $res .= '<img img src="' . wp_get_attachment_url($image) . '" alt="'.$title.'">';        
                    }
                    
                echo '<p>' . $carousel_build['url'] . '</p>';
                echo '<p>' . $carousel_build['caption'] . '</p>';
            }
    }

    Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)