cannabjs
Forum Replies Created
-
I updated to the latest version. When I edited the post and updated it, the post was lost
Forum: Fixing WordPress
In reply to: Add new custom field group from adminthank you
Forum: Fixing WordPress
In reply to: What is wrong in the database import ?error hosting or error code??
Forum: Fixing WordPress
In reply to: Help!!! show number categories of custom post type?My code
-
<?php
-
<?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<?php
$image = get_post_meta(get_the_id(), ‘image’,true);
?>
slug; ?>” title=”<?php echo $tax_term->name; ?>”>
<img src=”http://tattoovn.com/images/graphics/blank.gif” alt=”” height=”97″ width=”150″ style=”background:url(<?php echo $image ; ?>) no-repeat center center;background-size: 156px 103px;” />
<?php endwhile; // end of loop ?>
slug; ?>” title=”<?php echo $tax_term->name; ?>”><?php echo $tax_term->name; ?>
// List posts by the terms for a custom taxonomy of any post type
$post_type = ‘san-pham’;
$tax = ‘nhom-hang’;
$tax_terms = get_terms( $tax );
if ($tax_terms) {
foreach ($tax_terms as $tax_term) {
$args = array(
‘post_type’ => $post_type,
“$tax” => $tax_term->slug,
‘post_status’ => ‘publish’,
‘posts_per_page’ => -1,
‘caller_get_posts’=> 1,‘showposts’ => 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) : ?><?php else : ?>
<?php endif; // if have_posts()
wp_reset_query();
} // end foreach #tax_terms
}
?>It show all categories. How to display 4 categories????
Forum: Fixing WordPress
In reply to: Help!!! show number categories of custom post type?help me
Forum: Fixing WordPress
In reply to: How to add multiple images to a category??help me!!!!!!!!!!!!!
Forum: Fixing WordPress
In reply to: Missing argument 2 for wpdb::prepare()override any place in the file wp-db.php??
in the file that there are many prepare()
you specify more than?Forum: Fixing WordPress
In reply to: Remove category in the website path?I want to like this path: http://cameraquaylen.net/camera-nguy-trang
Sorry , I am not one programmer, so I do not understand the command
I do not want to use the plugin because it is difficult to customize
I want to display 2 interface for tag.php page.One page to show products by tag and one page to show the news by tag
Forum: Fixing WordPress
In reply to: POST PER PAGE IN SEARCH.PHP AND TAG.PHPthank you for all. I like tomontoast
Forum: Fixing WordPress
In reply to: [Help ]Query with wp_pagenavi?I’m currently having a problem with the page search.php and tag.php. It only display 5 posts on one page. How it shows 10 posts on one page .I use this code above but it did not work .Wp_pagenavi real trouble. Link: http://ww.wp.xz.cn/support/topic/post-per-page-in-searchphp-and-tagphp?replies=1
Forum: Fixing WordPress
In reply to: How to show custom taxonomy archivesIt can help you????
<?php $portfolioloop = new WP_Query( array( 'paged' => get_query_var('paged'), 'post_type' => 'post', // your post type 'cat' => 3, 'posts_per_page' => 10 ) );?> <?php while ( $portfolioloop->have_posts() ) : $portfolioloop->the_post(); ?> <?php endwhile; wp_reset_query();?> <div style="float:right; margin-top:20px;"> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi( array( 'query' => $portfolioloop ) ); } ?> </div>Forum: Fixing WordPress
In reply to: [Help ]Query with wp_pagenavi?full code
<?php get_header();?> <div class="main-container col2-left-layout"> <div class="main"> <div class="breadcrumbs"> <ul> <?php require_once('breadcrumb.php');?> </ul> </div> <div class="col-main"> <div class="home-products" style="margin-top:15px;"> <div class="block-title"> <strong id="abc"> <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );?> <?php //echo get_the_term_list( $post->ID, 'nhom-hang'); echo $term->name ?> </strong> </div> <?php if(have_posts() ){ ?> <ul class="products-grid"> <?php $paged = get_query_var('paged') ? get_query_var('paged') : 1; //query_posts('post_type=san-pham&posts_per_page=8&paged='.$paged); query_posts(array( 'post_type' => 'san-pham', 'showposts' => 9, 'paged' => $paged, 'order' => 'DESC', // tax_query: lọc theo danh mục 'tax_query' => array( array( 'taxonomy' => 'nhom-hang', 'field' => 'slug', 'terms' => get_queried_object()->slug ) ) ) ); ?> <?php $i=1; while(have_posts()) : the_post(); ?> <?php if ($i==1) {echo ' <li class="item first">';} ;?> <?php if ($i==2) {echo ' <li class="item">';} ;?> <?php if ($i==3) {echo ' <li class="item last">';} ;?> <?php if ($i==4) {echo ' <li class="item first">';} ;?> <?php if ($i==5) {echo ' <li class="item">';} ;?> <?php if ($i==6) {echo ' <li class="item last">';} ;?> <?php if ($i==7) {echo ' <li class="item first">';} ;?> <?php if ($i==8) {echo ' <li class="item">';} ;?> <?php if ($i==9) {echo ' <li class="item last">';} ;?> <div class="product-box"> <a href="<?php the_permalink();?>" title="<?php the_title();?>" class="product-image"> <img src="<?php echo get_post_meta($post->ID, 'image', true); ?>" width="204" height="204" alt="<?php the_title();?>"> </a> <h3 class="product-name"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php catchuoi_title(35); ?></a></h3> </div> <div class="clear"></div> <div class="price-box"> <?php $discount = get_post_meta(get_the_id(), 'discount',true); $price = get_post_meta(get_the_id(), 'price',true); ?> <?php if (!$discount) {?> <span class="regular-price" id="product-price-1-new"> <span class="price"><?php echo get_post_meta($post->ID, 'price', true); ?></span> </span> <?php } ?> <span class="regular-price" id="product-price-1-new"> <span class="price"><?php echo get_post_meta($post->ID, 'discount', true).'vnđ'; ?></span> </span> </div> <div class="clear"></div> <div class="actions"> <?php if(function_exists('addCartButton')){ addCartButton(get_the_id(),"Giỏ hàng"); } ?> <a class="button-view" href="<?php the_permalink();?>" title="View">Chi tiết</a> </div> </li> <?php $i++; endwhile ?> </ul> <?php } else{ ?> <h1>Chưa có sản phẩm!!!!!</h1> <?php } ?> </div> <div style="float:right; margin-top:20px;"> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> </div> </div> <?php get_sidebar('1');?> </div> <?php get_footer();?> -
<?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>