mty42
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Adding a carousel to the category templateHi,
Thank you for replying, yes that is what I want, but even with that link I’m not sure how to achieve it. I am not much good with PHP, copy, paste and hope for the best is not working this time…
I need a query that asks:
If a user is on category A then the page grabs the first 6 posts from A then lists the rest (7 – Nth) underneath, stoping after say 20 and paging the rest.
If they land on category B I want the same to happen, so one loop for all categories.
This is my very very poor code:
<h2 class="page-title"><?php single_cat_title(); ?></h2> // If less than page 2 <?php if ( $paged < 2 ) : ?> // Show this Carousel <?php if (is_category()) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); echo $cat_obj->name . " has id ". $cat_obj->term_id; } ?> <div class="flexslider"> <ul class="slides"> <?php $custom_query = new WP_Query(array( // Somehow get the current category ID... this does not work... 'category' => $cat_obj, 'post_status' => 'publish', 'post_type' => 'post', 'order' => 'ASC', 'orderby' => 'none', 'posts_per_page' => '6', 'offset' => '1', 'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1 )); while ($custom_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->ID; ?> <li class="carousel-article"> <a href="<?php the_permalink() ?>" rel="bookmark"> <article> <?php the_post_thumbnail(); ?> <div> <h3><?php the_title(); ?></h3> <?php the_excerpt(); ?> <?php the_category(); ?> </div> </article> </a> </li> <?php endwhile;?> </ul> </div> // Then display the rest of the results, this does not work well either <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php the_post_thumbnail(); ?> <div> <h3><?php the_title(); ?></h3> <?php the_excerpt(); ?> </div><!-- .entry-content --> </article><!-- #post --> <?php else : ?> // on page two and beyond show even more of the results <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php the_post_thumbnail(); ?> <div> <h3><?php the_title(); ?></h3> <?php the_excerpt(); ?> </div><!-- .entry-content --> </article><!-- #post --> <?php endif; ?>Forum: Fixing WordPress
In reply to: Adding a carousel to the category templateIs this not possible then? It must be. Please help WP boffins!
Hi, Sorry I’ve disabled the plugin for the time being. Actually I have another plugin that shows the facebook and twitter likes so I was going to replace that with one that could do everything.
I will reactivate it until you have had chance to look at it. It should appear at the bottom of the posts just below the facebook and twitter like buttons above the comments box.
Thank you
Does not show in IE 7. Does show up in 8.