0

I have a slider setup that is querying shopp categories that have products here: http://halliescomet.com/

Here's my code:

<div class="flexslider-holder">
<div class="flexslider-container">
    <div class="flexslider">
        <ul class="slides">
        <?php if( shopp('catalog','has-categories')) : ?>
             <?php while(shopp('catalog','categories')): ?>
             <?php
            // Skip sub-categories
            if (shopp('category','parent','return=1') > 0) continue;  ?>
             <li>
                        <a href='<?php shopp('category','url'); ?>'> 
                        <?php shopp('category','coverimage','width=545&height=260&fit=crop'); ?><br style="clear: both;" />
                        </a>
                        <div class='flex-caption'>
                            <h2><?php shopp('category','name'); ?></h2>
                            <?php shopp('category','description'); ?>

                            <a class="learnmore" href="<?php shopp('category','url'); ?>">View All</a>
                        </div>


            </li>




        <?php endwhile; ?>
        <?php endif; ?>
        </ul>
        <?php wp_reset_query();?>
    </div>
</div>

I'd What I would like to do is combine that with a custom post type labeled "slides" so I am able to add non shopp content to the slider. Anyone know if this is do-able? Since the shopp while is different I am not sure how to go about this.

Any help is again appreciated.

0

You could do this by using a custom query. Or you just create an array and load the shopp items to it and then the items of your custom post type.

  • So, would you set up something like this? query_posts( array( 'post_type' => array( 'slides', '(shopp('catalog','categories'))' ) ) ); if ( have_posts() ) : while( have_posts() ) : the_post(); – mtuttle Mar 4 '14 at 17:02
  • exactly. but don't forget to reset the query after this. – Jonathan Mar 4 '14 at 17:03
  • If I don't would it kill my page? I tried it without resetting and it did :) – mtuttle Mar 4 '14 at 17:04
  • better do so there will be no error with any plugins or if you want to add a blog or so ;) – Jonathan Mar 4 '14 at 17:46
  • I don't think I'm understanding this fully, Would I need to add an if else statement in the list items below as well? – mtuttle Mar 4 '14 at 17:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.