I have this code for showing new product as hscroll in mobile theme
but I want to don't show a category product with 1230 id
I add think by adding some code like: $products->category-> != 1230 to first if
please guide
<?php
// new arrivals products
$new_args = array(
'post_type' => 'product',
'posts_per_page' => 8,
'orderby' =>'date',
'order' => 'DESC'
);
$products = new WP_Query( $new_args );
?>
<?php if ( $products->have_posts() ) { ?>
<div class="title-intro content-block-title"><?php _e( 'New Arrivals', 'woomobify' ); ?></div>
<div class="product-hscroll swiper-container swiper-init" data-auto-height="true" data-free-mode="true" data-slides-per-view="auto">
<div class="swiper-wrapper">
<?php while ( $products->have_posts() ) : $products->the_post(); global $product; ?>
<div class="swiper-slide">
<div class="card">
<div class="card-content">
<a href="<?= get_the_permalink(); ?>">
<?php
if ( has_post_thumbnail($products->post->ID) ) {
echo get_the_post_thumbnail( $products->post->ID, 'shop_catalog' );
} else {
echo '<img src="'.wc_placeholder_img_src().'"/>';
} ?>
</a>
<div class="title"><?php the_title(); ?></div>
<div class="item-text product-price">
<span class="price"><?= wc_price( $product->get_price() ); ?></span>
</div> </div> </div>
<?php endwhile; ?>
I think the solution you are looking for is described at
https://docs.woocommerce.com/document/exclude-a-category-from-the-shop-page/
or to make it more easy, use the next arguments to retrieve all products except if the product is in the category(id) 1230
$args = array(
'posts_per_page' => -1,
'orderby' =>'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => array('1230'),
'operator' => 'NOT IN')));
Related
I am creating a shortcode in a wordpress theme which needs to show properties on area based it was working fine. I have tried to keep 10 area title which was custom one. For that i called varable as $area_title1 to 10 in the wordpress loop also i have added a counter and called the counter with the variable for getting $area_title1 i called variable as $area_title.$counter which was without counting it shows exactly the value for example 1 , 2, etc my code is below.
function home_category_with_image_session($atts){
ob_start();
$atts = shortcode_atts(
array(
'propertytype' => '',
'area' => '',
'area1' => '',
'area2' => '',
'area3' => '',
'area4' => '',
'area5' => '',
'area6' => '',
'area7' => '',
'area8' => '',
'area9' => '',
'area_title' => '',
'area1_title' => '',
'area2_title' => '',
'area3_title' => '',
'area4_title' => '',
'area5_title' => '',
'area6_title' => '',
'area7_title' => '',
'area8_title' => '',
'area9_title' => '',
),
$atts,
'home_category_type'
);
$area=$atts['area'];
$area1=$atts['area1'];
$area2=$atts['area2'];
$area3=$atts['area3'];
$area4=$atts['area4'];
$area5=$atts['area5'];
$area6=$atts['area6'];
$area7=$atts['area7'];
$area8=$atts['area8'];
$area9=$atts['area9'];
$area_title=$atts['area_title'];
$area_title1=$atts['area1_title'];
$area_title2=$atts['area2_title'];
$area_title3=$atts['area3_title'];
$area_title4=$atts['area4_title'];
$area_title5=$atts['area5_title'];
$area_title6=$atts['area6_title'];
$area_title7=$atts['area7_title'];
$area_title8=$atts['area8_title'];
$area_title9=$atts['area9_title'];
$property_type=$atts['propertytype'];
$custom_terms = get_terms(array ('taxonomy' => 'property_city_taxonomy',
'orderby' => 'count',
'order' => 'ASC',
'name' => array ($area, $area1, $area2, $area3, $area4, $area5, $area6, $area7, $area8, $area9 ),
) );
$counter = -1;
foreach($custom_terms as $custom_term) {
wp_reset_query();
$args = array('post_type' => $property_type,
'tax_query' => array(
array(
'taxonomy' => 'property_city_taxonomy',
'field' => 'slug',
'terms' => $custom_term->slug,
),
),
);
$loop = new WP_Query($args);
if($loop->have_posts())
{
$counter++ ?>
<div class="col-md-3 col-sm-4 col-xs-6"><a href="<?php echo get_term_link($custom_term); ?>?property-type=<?php echo "$property_type"; ?>"><div class="top-locations"><div class="image-holder">
<?php $custom_term_id = $custom_term->term_id;
$custom_term_meta = get_term_meta( $custom_term_id, 'uploadimage_61032', true );
$num = $loop->post_count;
$area_title_display = $area_title.$counter;
?>
<img src="<?php echo $custom_term_meta; ?>" alt="<?php echo $term->name; ?>" class="img-responsive" />
<?php echo $area_title_display; ?>
<div class="home-banner-overlay"></div>
<div class="area-name"><?php echo $custom_term->name; ?></div>
</div><div class="city-text-container text-center"><?php echo $num; ?> Properties Listed</div></div></a></div>
<?php
} }
// Restore original post data.
wp_reset_postdata();
return ob_get_clean(); }
add_shortcode('home_category_type', 'home_category_with_image_session');
//Featured Post Home
function home_featured_posts($atts){
ob_start();
$atts = shortcode_atts(
array(
'no' => '',
'posttype' => '',
),
$atts,
'home-featured'
);
?>
<div class="session-featured-title">
<h5>Featured Property <?php echo $atts['posttype']; ?></h5>
<div class="related-control"><a class="btn prev"><i class="fa fa-arrow-left"></i></a><a class="btn next"><i class="fa fa-arrow-right"></i></a></div>
</div>
<div id="featured" class="owl-carousel owl-theme">
<?php
$args_1= array(
'post_type' => $atts['posttype'],
'posts_per_page' => $atts['no'],
'meta_query' => array(
array(
'key' => 'we_recommend_make-featured-property',
'value' => '1'
)
)
);
query_posts($args_1); if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="item"><a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?>">
<div class="featured-image">
<?php the_post_thumbnail('full', array('class' => 'img-responsive') ); ?></div>
<div class="featured-text-holder">
<div class="recent-post-title"><?php the_title(); ?></div>
<div class="featured-meta-detail">
<div class="py-list-price"><?php ro_price(); ?></div>
<div class="py-list-bed"><?php ro_bedroom(); ?></div>
<div class="py-list-bath"><?php ro_bathroom(); ?></div>
</div>
</div>
</a></div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
Here is your questions answer in php Refer This
And modified code of yours is below.
function home_category_with_image_session($atts){
ob_start();
$atts = shortcode_atts(
array(
'propertytype' => '',
'area' => '',
'area1' => '',
'area2' => '',
'area3' => '',
'area4' => '',
'area5' => '',
'area6' => '',
'area7' => '',
'area8' => '',
'area9' => '',
'area_title' => '',
'area1_title' => '',
'area2_title' => '',
'area3_title' => '',
'area4_title' => '',
'area5_title' => '',
'area6_title' => '',
'area7_title' => '',
'area8_title' => '',
'area9_title' => '',
),
$atts,
'home_category_type'
);
$area=$atts['area'];
$area1=$atts['area1'];
$area2=$atts['area2'];
$area3=$atts['area3'];
$area4=$atts['area4'];
$area5=$atts['area5'];
$area6=$atts['area6'];
$area7=$atts['area7'];
$area8=$atts['area8'];
$area9=$atts['area9'];
$area_title[0]=$atts['area_title'];
$area_title[1]=$atts['area1_title'];
$area_title[2]=$atts['area2_title'];
$area_title[3]=$atts['area3_title'];
$area_title[4]=$atts['area4_title'];
$area_title[5]=$atts['area5_title'];
$area_title[6]=$atts['area6_title'];
$area_title[7]=$atts['area7_title'];
$area_title[8]=$atts['area8_title'];
$area_title[9]=$atts['area9_title'];
$property_type=$atts['propertytype'];
$custom_terms = get_terms(array ('taxonomy' => 'property_city_taxonomy',
'orderby' => 'count',
'order' => 'ASC',
'name' => array ($area, $area1, $area2, $area3, $area4, $area5, $area6, $area7, $area8, $area9 ),
) );
$counter = -1;
foreach($custom_terms as $custom_term) {
wp_reset_query();
$args = array('post_type' => $property_type,
'tax_query' => array(
array(
'taxonomy' => 'property_city_taxonomy',
'field' => 'slug',
'terms' => $custom_term->slug,
),
),
);
$loop = new WP_Query($args);
if($loop->have_posts())
{
$counter++ ?>
<div class="col-md-3 col-sm-4 col-xs-6"><a href="<?php echo get_term_link($custom_term); ?>?property-type=<?php echo "$property_type"; ?>"><div class="top-locations"><div class="image-holder">
<?php $custom_term_id = $custom_term->term_id;
$custom_term_meta = get_term_meta( $custom_term_id, 'uploadimage_61032', true );
$num = $loop->post_count;
$area_title_display = '$area_title'.$counter;
echo $area_title[$counter];
?>
<img src="<?php echo $custom_term_meta; ?>" alt="<?php echo $term->name; ?>" class="img-responsive" />
<?php echo $area_title_display; ?>
<div class="home-banner-overlay"></div>
<div class="area-name"><?php echo $custom_term->name; ?></div>
</div><div class="city-text-container text-center"><?php echo $num; ?> Properties Listed</div></div></a></div>
<?php
}
}
// Restore original post data.
wp_reset_postdata();
return ob_get_clean(); }
add_shortcode('home_category_type', 'home_category_with_image_session');
//Featured Post Home
function home_featured_posts($atts){
ob_start();
$atts = shortcode_atts(
array(
'no' => '',
'posttype' => '',
),
$atts,
'home-featured'
);
?>
<div class="session-featured-title">
<h5>Featured Property <?php echo $atts['posttype']; ?></h5>
<div class="related-control"><a class="btn prev"><i class="fa fa-arrow-left"></i></a><a class="btn next"><i class="fa fa-arrow-right"></i></a></div>
</div>
<div id="featured" class="owl-carousel owl-theme">
<?php
$args_1= array(
'post_type' => $atts['posttype'],
'posts_per_page' => $atts['no'],
'meta_query' => array(
array(
'key' => 'we_recommend_make-featured-property',
'value' => '1'
)
)
);
query_posts($args_1); if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="item"><a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?>">
<div class="featured-image">
<?php the_post_thumbnail('full', array('class' => 'img-responsive') ); ?></div>
<div class="featured-text-holder">
<div class="recent-post-title"><?php the_title(); ?></div>
<div class="featured-meta-detail">
<div class="py-list-price"><?php ro_price(); ?></div>
<div class="py-list-bed"><?php ro_bedroom(); ?></div>
<div class="py-list-bath"><?php ro_bathroom(); ?></div>
</div>
</div>
</a></div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
I am sure this will works for you.
I've been through other posts on here and elsewhere and compared my code to working examples I've done previously, but I can't find what the issue is. I;m using the following query to grab a featured article and store its ID:
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => 1,
'orderby' => 'date',
'order' => 'desc',
'post_status' => 'publish',
'cat' => 564,
);
$featured_latest = new WP_Query($args);
$fid = array();
if( $featured_latest->have_posts() ) : while( $featured_latest->have_posts() ) : $featured_latest->the_post(); ?>
<?php $fid[] = get_the_ID(); ?>
<div class="top-featured">
<?php if( has_post_thumbnail() ) { ?>
<?php $image = get_the_post_thumbnail_url(get_the_ID(),'large'); ?>
<?php } else { ?>
<?php $image = get_stylesheet_directory_uri() . '/assets/images/blog/no-article-image.jpg'; ?>
<?php } ?>
<a class="article-link lazy" href="<?php the_permalink(); ?>" data-src="<?php echo $image; ?>">
<div class="text">
<h2><?php the_title(); ?></h2>
<?php
$date = get_the_date();
$cdate = date( 'c', strtotime($date) );
?>
<time datetime="<?php echo $cdate; ?>"><?php echo $date; ?></time>
<div class="excerpt">
<?php echo get_excerpt(140); ?>
</div>
<span class="fake-link">Read article</span>
</div>
</a>
</div>
<?php endwhile; wp_reset_postdata(); endif; ?>
Then lower down the page I use this query:
<?php
if( !empty( $fid ) ){
$fid = $fid;
} else {
$fid = array();
}
$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'desc',
'post_status' => 'publish',
'cat' => 399,
'post__not_in' => $fid,
);
$top_reviews = new WP_Query($args);
if( $top_reviews->have_posts() ) : ?>
<div class="top-articles top-reviews">
<h2>Top product reviews</h2>
<div class="row">
<?php while( $top_reviews->have_posts() ) : $top_reviews->the_post(); ?>
<div class="col-12 col-md-4">
<?php if( has_post_thumbnail() ) { ?>
<?php $image = get_the_post_thumbnail_url(get_the_ID(),'large'); ?>
<?php $imgid = get_post_thumbnail_id( get_the_ID() ); ?>
<?php $alt = get_post_meta( $imgid, '_wp_attachment_image_alt', true); ?>
<?php } else { ?>
<?php $image = get_stylesheet_directory_uri() . '/assets/images/blog/no-article-image.jpg'; ?>
<?php $alt = 'No article image'; ?>
<?php } ?>
<a class="article-link" href="<?php the_permalink(); ?>" data-src="<?php echo $image; ?>">
<img class="lazy" data-src="<?php echo $image; ?>" alt="<?php echo $alt; ?>">
<div class="text">
<h3><?php the_title(); ?></h3>
<?php
$date = get_the_date();
$cdate = date( 'c', strtotime($date) );
?>
<time datetime="<?php echo $cdate; ?>"><?php echo $date; ?></time>
<div class="excerpt">
<?php echo get_excerpt(140); ?>
</div>
<span class="fake-link">Read article</span>
</div>
</a>
</div><!-- col -->
<?php endwhile; wp_reset_postdata(); ?>
</div><!-- row -->
</div>
<?php endif; ?>
$fid prints as an array with one item inside, but the second query does not exclude the post of that ID. I'm sure there's something glaringly obvious that I'm missing, but I can't for the life of me find it!
May be some other plugin or theme features overrides the array? var_dump and try what are the query_vars in the WP_Query object. then you can identify it. Or simply deactivate all the plugins and activate it one by one. then you can identify surely!
if any plugin overrides it, they should use a hook to do it. so search and see the priority of the hook. and then just you override it with high priority hook. example below.
add_action('pre_get_posts', 'your_callback_function_name', 999)
function your_callback_function_name($query){
$overridden_array = $query->get('post__not_in', array());
$overridden_array[] = $your_f_id;
$query->set('post__not_in', $overridden_array);
}
Thats all. Just rename those functions and variables as your wish.
You need to pass array in this format array('162','3074')
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'desc',
'post_status' => 'publish',
'post__not_in' => array('162','3074')
);
$top_reviews = new WP_Query($args);
Its working fine for me.. you can try in same way.
post__not_in (array) - use post ids. Specify post NOT to retrieve. If this is used in the same query as post__in, it will be ignored.
Change post__not_in value into Array.
$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'desc',
'post_status' => 'publish',
'cat' => 399,
'post__not_in' => array('YOUR_POST_ID1','YOUR_POST_ID2'),
);
For more help see this link : Click Here
When printing out the WP_Query resuls, I found that the following was happening:
WP_Query Object ( [query] => Array ( [post_type] => post [posts_per_page] => 3 [orderby] => date [order] => desc [post_status] => publish [cat] => 399 [post__not_in] => Array ( [0] => 8117 ) ) [query_vars] => Array ( [post_type] => post [posts_per_page] => 3 [orderby] => date [order] => DESC [post_status] => publish [cat] => 399 [post__not_in] => Array ( [0] => 7990 )
It was suggested to me by dineshkashera that the pre_get_posts() filter may have been the cause. As I was not using this myself, I troubleshooted for plugin conflicts by deactivating all those that were not regular ones I used. After reactivating them one at a time, I found that the culprit was the Woocommerce Point of Sale plugin. I have deactivated this plugin for now and will seek a solution from the developer.
Update 2
Adding name as field instead of the slug and adding the_title() just give me an echo of the page title...
$args = array(
'post_type' => 'feestlocaties',
'showposts' => '3',
'orderby' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'locatie',
'field' => 'name',
'terms' => the_title(),
),
),
);
Update Jonnhyd23's code worked like a charm!! Thanks!
Is there a way you can make the terms dynamic? Like the title is Amsterdam can I do something like 'terms' => '<?php the_title(); ?>' or something like that?
I've been going at this for the last couple of hours. Maybe someone here can help me?
I want to show specif posts from a custom taxonomy in a loop.
This is the situation:
custom taxonomy: feestlocaties
And the the posts i want to show have Amsterdam selected (checked) (like categories).
Code i tried:
<div id="main-filter">
<!-- Start the Loop. -->
<?php $args = array(
'post_type' => 'feestlocaties',
'tax_query' => array(
array(
'taxonomy' => 'locatie',
'field' => 'slug',
'terms' => 'amsterdam',
),
),
); ?>
<?php $query = new WP_Query( $args ); ?>
<?php if( $query->have_posts() ): while( $query->have_posts() ): $query->the_post(); ?>
<!-- Test if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
<!-- Otherwise, the div box is given the CSS class "post". -->
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<div class="container post-item">
<div class="col-sm-3 no-padding">
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<?php the_post_thumbnail(array(400,355)); // Declare pixel size you need inside the array ?>
<?php endif; ?>
</div>
<div class="col-sm-9 no-padding">
<h1 class="overzicht"><?php the_title(); ?></h1>
<?php html5wp_excerpt('html5wp_index'); ?>
<div class="col-sm-12 no-padding loop-overzicht">
<?php $prijs = get_Field('vanaf_prijs'); ?>
<?php $pers = get_Field('aantal_personen'); ?>
<?php $time = get_Field('tijdsduur'); ?>
<ul class="loop-opsomming text-right">
<li><?php echo '<i class="fa fa-euro"></i>Vanaf ' . $prijs . ' p.p.' ?></li>
<li><?php echo '<i class="fa fa-group"></i>Vanaf ' . $pers . ' personen' ?></li>
<li><?php echo '<i class="fa fa-clock-o"></i>Vanaf ' . $time . ' uur' ?></li>
</ul>
</div>
</div>
</div>
</a>
<?php wp_pagenavi(); ?>
<?php endwhile; endif; wp_reset_postdata(); ?>
</div>
But nothing is showing. Any help would be great. Thanks!
Are you just showing the arguments you're using for WP_Query, or is this all of your code? Try using the tax_query parameter.
$args = array(
'post_type' => 'your_post_type',
'tax_query' => array(
array(
'taxonomy' => 'feestlocaties',
'field' => 'slug',
'terms' => 'amsterdam',
),
),
);
$query = new WP_Query( $args );
if( $query->have_posts() ): while( $query->have_posts() ): $query->the_post();
//execute code
endwhile; endif; wp_reset_postdata();
So, I fiddeld around abit and this is the code that works for me. Cheers Johnnyd23
<?php $args = array(
'post_type' => 'feestlocaties',
'showposts' => '3',
'orderby' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'locatie',
'field' => 'name',
'terms' => get_the_title(),
),
),
); ?>
<?php $query = new WP_Query( $args ); ?>
<?php if( $query->have_posts() ): while( $query->have_posts() ): $query->the_post(); ?>
This will make the title the post dynamicly in the WP_Query.
I have a custom post type (question) related to a custom taxonomy (support)
In my-theme/taxonomy.php I have this code:
<?php
$taxonomy = get_queried_object()->taxonomy;
if ($taxonomy == 'support')
{
get_template_part('template/support/categories');
exit;
}
wp_safe_redirect(site_url('/'));
exit;
?>
Means I target a specific template file for "support" taxonomy.
In my taxonomy template file I make a custom query:
<?php $current_category = get_term_by('id', get_queried_object()->term_id, 'support'); ?>
<?php $questions = new WP_Query(array(
'post_type' => array('question'),
'post_status' => 'publish',
'posts_per_page' => 5,
'posts_per_archive_page' => 5,
'paged' => ((get_query_var('page')) ? get_query_var('page') : 1),
'nopaging' => false,
'tax_query' => array(
array(
'taxonomy' => 'support',
'terms' => array($current_category->term_id)
)
),
'orderby' => 'menu_order',
'order' => 'ASC'
)); ?>
<?php if ($questions->have_posts()): ?>
<ul class="list normalize">
<?php while ($questions->have_posts()) : $questions->the_post(); ?>
<li>
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<div class="nav-previous">
<?php next_posts_link( __('Previous', 'my-theme'); ?>
</div>
<div class="nav-next">
<?php previous_posts_link( __('Next', 'my-theme'); ?>
</div>
<?php wp_reset_postdata(); ?>
I have about 11 posts, page 1 shows the 5 first posts, but the problem is that no pagination is shown.
Any idea?
Thank you
You can try this pagination plugin
http://wordpress.org/plugins/wp-pagenavi/
And add this code in your template
<?php if (!function_exists('wp-pagenavi')) { wp_pagenavi(); } else { ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div><?php } ?>
I tried Your code and with my taxonomy
<?php $questions = new WP_Query(array(
'post_type' => array('studies'),
'post_status' => 'publish',
'posts_per_page' => 15,
'paged' => get_query_var('paged'),
'nopaging' => false,
'tax_query' => array(
array(
'taxonomy' => 'studies',
'terms' => 11
)
),
'orderby' => 'menu_order',
'order' => 'ASC'
));
?>
<div class="grid9">
<div class="entry-content">
<?php if ($questions->have_posts()): ?>
<ul class="list normalize">
<?php while ($questions->have_posts()) : $questions->the_post(); ?>
<li>
<h3><?php echo get_the_title(); ?></h3>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php
wp_pagenavi( array( 'query' => $questions ) );
?>
This works fine ,Don't forget to use wp-pagenavi plugin.
Put this code above the "endif;" and just below the end of while loop.
<div class="nav-previous">
<?php next_posts_link( __('Previous', 'my-theme'); ?>
</div>
<div class="nav-next">
<?php previous_posts_link( __('Next', 'my-theme'); ?>
</div>
<?php wp_reset_postdata(); ?>
Hope this helps you.
Ussually this works for me:
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $questions->max_num_pages
) );
Notice the question variable. :-) After you use this, go to Settings->Permalink and Save twice.
You can find a bigger tutorial here with the same example.
Having a little trouble here, I'm wanting to get all images from posts and display them in two separate locations, one location showing one image and the second location showing all the image.
If i use the Query it grabs all post image and with out using Query it grabs one image from the page. any ideas on how to get all images from page instead of posts???
<div id="fp_gallery" class="fp_gallery">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $args = array( 'numberposts' => 1, 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'post_parent' =>
$post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ( $attachments as $attachment ) { ?>
<img src="<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>" alt="" class="fp_preview" style=""/>
<?php }}?>
<?php endwhile; endif; ?>
<div class="fp_overlay"></div>
<div id="fp_loading" class="fp_loading"></div>
<div id="fp_next" class="fp_next"></div>
<div id="fp_prev" class="fp_prev"></div>
<div id="outer_container">
<div id="thumbScroller">
<div class="container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $args = array( 'numberposts' => 9999, 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ( $attachments as $attachment ) { ?>
<div class="content">
<div>
<a href="#" title="<?php the_title(); ?>">
<img src="<?php echo get_bloginfo('template_url');?>/js/timthumb.php?src=<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>&h=120&w=150&zc=1" alt="<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>" class="thumb"/>
</a>
</div>
</div>
<?php }}?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
</div>
<div id="fp_thumbtoggle" class="fp_thumbtoggle" title="View Thumbs">↑</div>
Any help would be great : )
Make numberposts -1 it will collect all posts under category
$args = array( 'numberposts' => 1, 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'post_parent' =>
$post->ID );
But i'm not sure about jQuery thing you are talking about.