wp: axaj рекомендуемое изменение изображения с изменением выберите заголовок сообщения из опций - PullRequest
0 голосов
/ 13 сентября 2018

У меня есть пост типа [услуги] цикл все параметры типа поста а при выборе опции показать свое изображение

enter code here
<form method="post" action="">
        <div class="form-group-field">
            <div class="left_label"><label>
                    Select Post
                </label></div>
            <div class="rigth_input">
                <select id="vzxms-post-slct" name="vzxms-post-slct" class="vzxms-post-slct">
                    <?php
                    $args = array( 'post_type'=>'services');
                    $myposts = get_posts( $args );
                    foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
                        <option value="<?php echo get_permalink();?>&json=1"><?php the_title(); ?></option>
                    <?php endforeach;
                    wp_reset_postdata();?>
                </select>
                <!-- and here i want to show image -->
                <?php
                // $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'post');
                // echo $thumb[0];
                ?>
                <!--<img src="<?php echo $thumb[0]; ?>" id="post-thumb"/>-->
                <h6 id="post-tit"></h6>
                <div id="post-cont"></div>
            </div>
        </div>
    </form>

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...