0

In my website there is post thumbnail slider along with post featured image. Post thumbnail slider will show images related with blog post. I want when we write any post then it will allow me to upload few images in post editor itself and will display it. How can i achieve this task? Plz help

This is my single.php

<?php get_header(); ?>
<?php get_template_part('nss','header'); ?>

        <div class="main-wrapper">

            <div class="container-3x">

                <div class="post-wrapper">

                    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
                    <span class="post-title">
                        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                    </span>

                    <div class="post-content">

                        <div class="thumbnails" id="post-thumbs">
                            <img src="<?php print IMAGES; ?>/posts/1.jpg" alt="First"/>
                            <img src="<?php print IMAGES; ?>/posts/2.jpg" alt="Second"/>
                            <img src="<?php print IMAGES; ?>/posts/3.jpg" alt="Third"/>
                            <img src="<?php print IMAGES; ?>/posts/1.jpg" alt="Fourth"/>
                            <img src="<?php print IMAGES; ?>/posts/2.jpg" alt="Fifth"/>
                            <img src="<?php print IMAGES; ?>/posts/3.jpg" alt="Sixth"/>
                        </div>

                        <div class="buttons">

                            <span>
                                <?php

                                $nss_meta = get_post_meta( get_the_ID(),'');
                                $x= $nss_meta[_my_meta_value_key][0];
                                echo "<a target='_blank' href=$x>Check Preview</a>";
                         ?>
                            </span>

                            <span>
                            <?php $nss_meta = get_post_meta( get_the_ID(),'');
                            $nss_html = $nss_meta[nss_html_download_value_key][0];
                            $nss_psd = $nss_meta[nss_psd_download_value_key][0];
                            $nss_xml = $nss_meta[nss_blogger_download_value_key][0];
                            $nss_single_file_link = $nss_meta[nss_single_file_download_value_key][0];
                            $nss_single_file_title = $nss_meta[nss_single_file_title_value_key][0];
                            $perm = get_permalink();
                            if((!empty($nss_single_file_link)) && (!empty($nss_single_file_title)) && ((empty($nss_html)) || (empty($nss_psd)) || empty($nss_xml)))
                                {
                                    echo "<a href=$nss_single_file_link>$nss_single_file_title</a>";
                                } 

                            else {

                                echo "<a id='download' href=$perm>Download Files</a>";
                                    echo "<ul id='lists'>";
                                             if(!empty($nss_html)) {echo "<li><a target='_blank' href=$nss_html>Download HTML</a><li>";}
                                             if(!empty($nss_psd)) {echo "<li><a target='_blank' href=$nss_psd>Download PSD</a><li>";}
                                             if(!empty($nss_xml)) {echo "<li><a target='_blank' href=$nss_xml>Download XML</a><li>";}
                                    echo "</ul>";

                                 }

                                ?>
                            </span>

                        </div>

                        <div class="post-meta">
                            <span class="author"><i class="ico-icon-user-2"></i><a href="">Raunak Hajela</a></span>
                            <span class="tags"><i class="ico-icon-tag"></i> <?php the_tags(' ',' &nbsp; '); ?>
                            </span>
                        </div>

                        <p class="summary">
                        <?php the_content(); ?></p>

                    </div>
                <?php endwhile; else : ?>
                    <?php endif; ?>
                    <div class="clr"></div>

                    <!-- search widget starts here -->
                    <div class="search widgets">
                        <?php get_search_form(); ?>
                    </div>
                    <!-- search widget ends here -->

                    <!-- detail widget starts here-->
                    <div class="post-details">
                        <?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('nss-details') ) : ?>
                       <?php endif; ?>
                    </div>
                    <!-- detail widget ends here-->

                    <div class="sidebar-wrapper">
                        <?php get_sidebar(); ?>
                    </div>


                    </div>

                </div>


            </div>
        </div>
<?php get_footer(); ?>

Check this line of code which is displaying slider in single.php

<div class="thumbnails" id="post-thumbs">
    <img src="<?php print IMAGES; ?>/posts/1.jpg" alt="First"/>
    <img src="<?php print IMAGES; ?>/posts/2.jpg" alt="Second"/>
    <img src="<?php print IMAGES; ?>/posts/3.jpg" alt="Third"/>
    <img src="<?php print IMAGES; ?>/posts/1.jpg" alt="Fourth"/>
    <img src="<?php print IMAGES; ?>/posts/2.jpg" alt="Fifth"/>
    <img src="<?php print IMAGES; ?>/posts/3.jpg" alt="Sixth"/>
</div>

I want to display post slider in between above line of code i.e

<div class="thumbnails" id="post-thumbs">
  #your slider code goes her
</div>

You can also check this link to preview my single.php file

  • This is a little too broad. How do you want to store information? What do you imagine interface will look like? What had you tried and how far you got? – Rarst Dec 13 '14 at 15:58
  • i don't know , i am not getting how can i do this...i am just thinking is there any option so that i can do this... i mean in editor it will ask me to upload few images via media uploader and display it in single.php – Raunak Hajela Dec 14 '14 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.