asemon14 36 ارسال شده در بهمن 92 گزارش بازنشر ارسال شده در بهمن 92 سلامکد زیر کد صفحه اول قالبم هست که برای افزونه edd تنظیم شده است و محصولات دانلودی را نمایش می دهدمشکل من اینه که همه مطالب اول صفحه قرار میگیرند و نمی دونم چطور و با چه کدی تنظیم کنم که فقط 9 محصول صفحه اول باشند و صفحه گذاری بشه مطالب.اینم کد صفحه اول<?php get_header(); ?><div id="main-content" class="row store-template"><?php putRevSlider("slider1","homepage") ?> <div class="content clearfix"> <?php $current_page = get_query_var('page'); $per_page = get_option('posts_per_page'); $offset = $current_page > 0 ? $per_page * ($current_page-1) : 0; $product_args = array( 'post_type' => 'download', 'posts_per_page' => $per_page, 'offset' => $offset ); $products = new WP_Query($product_args); ?> <?php if ($products->have_posts()) : $i = 1; ?> <?php while ($products->have_posts()) : $products->the_post(); ?> <div class="threecol product<?php if($i % 4 == 0) { echo ' last'; } ?>"> <a href="<?php the_permalink(); ?>"> <h2 class="title"><?php the_title(); ?></h2> </a> <div class="product-image"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('product-image'); ?> </a> <?php if(function_exists('edd_price')) { ?> <div class="product-price"> <?php if(edd_has_variable_prices(get_the_ID())) { // if the download has variable prices, show the first one as a starting price echo 'Starting at: '; edd_price(get_the_ID()); } else { edd_price(get_the_ID()); } ?> </div><!--end .product-price--> <?php } ?> </div> <?php if(function_exists('edd_price')) { ?> <div class="product-buttons"> <?php if(!edd_has_variable_prices(get_the_ID())) { ?> <?php echo edd_get_purchase_link(get_the_ID(), 'Add to Cart', 'button'); ?> <a href="<?php the_permalink(); ?>">نمایش جزئیات</a> <?php } ?> </div><!--end .product-buttons--> <?php } ?> </div><!--end .product--> <?php $i+=1; ?> <?php endwhile; ?> <div class="pagination"> <?php $big = 2; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, $current_page ), 'total' => $products->max_num_pages ) ); ?> </div> <?php else : ?> <h2 class="center">پیدا نشد</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> </div><!--end .content--></div><!--end #main-content.row--><?php get_footer(); ?>ادرس سایتم هم این هست اگه لازمه ببینیدhttp://ketabdaneshju.ir نقل قول لینک به ارسال
Bright Moon 653 ارسال شده در بهمن 92 گزارش بازنشر ارسال شده در بهمن 92 سلام.افزونه WP-PageNavi رو نصب و فعال کنید.وارد تنظیمات وردپرس خودتون بشید > خواندن > بیشترین تعداد نوشتهها در هر برگهی وبلاگ = 10کد زیر رو جایگزین کد خودتون کنید:<?php get_header(); ?><div id="main-content" class="row store-template"><?php putRevSlider("slider1","homepage") ?> <div class="content clearfix"> <?php $current_page = get_query_var('page'); $per_page = get_option('posts_per_page'); $offset = $current_page > 0 ? $per_page * ($current_page-1) : 0; $product_args = array( 'post_type' => 'download', 'posts_per_page' => $per_page, 'offset' => $offset ); $products = new WP_Query($product_args); ?> <?php if ($products->have_posts()) : $i = 1; ?> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array('paged' => $paged)); while (have_posts()):the_post();?> <div class="threecol product<?php if($i % 4 == 0) { echo ' last'; } ?>"> <a href="<?php the_permalink(); ?>"> <h2 class="title"><?php the_title(); ?></h2> </a> <div class="product-image"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('product-image'); ?> </a> <?php if(function_exists('edd_price')) { ?> <div class="product-price"> <?php if(edd_has_variable_prices(get_the_ID())) { // if the download has variable prices, show the first one as a starting price echo 'Starting at: '; edd_price(get_the_ID()); } else { edd_price(get_the_ID()); } ?> </div><!--end .product-price--> <?php } ?> </div> <?php if(function_exists('edd_price')) { ?> <div class="product-buttons"> <?php if(!edd_has_variable_prices(get_the_ID())) { ?> <?php echo edd_get_purchase_link(get_the_ID(), 'Add to Cart', 'button'); ?> <a href="<?php the_permalink(); ?>">نمایش جزئیات</a> <?php } ?> </div><!--end .product-buttons--> <?php } ?> </div><!--end .product--> <?php $i+=1; ?> <?php endwhile;?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }?> <div class="pagination"> <?php $big = 2; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, $current_page ), 'total' => $products->max_num_pages ) ); ?> </div> <?php else : ?> <h2 class="center">پیدا نشد</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> </div><!--end .content--></div><!--end #main-content.row--><?php get_footer(); ?> 2 نقل قول لینک به ارسال
asemon14 36 ارسال شده در بهمن 92 مالک گزارش بازنشر ارسال شده در بهمن 92 سلام.افزونه WP-PageNavi رو نصب و فعال کنید.وارد تنظیمات وردپرس خودتون بشید > خواندن > بیشترین تعداد نوشتهها در هر برگهی وبلاگ = 10کد زیر رو جایگزین کد خودتون کنید:<?php get_header(); ?><div id="main-content" class="row store-template"><?php putRevSlider("slider1","homepage") ?><div class="content clearfix"><?php$current_page = get_query_var('page');$per_page = get_option('posts_per_page');$offset = $current_page > 0 ? $per_page * ($current_page-1) : 0;$product_args = array( 'post_type' => 'download', 'posts_per_page' => $per_page, 'offset' => $offset);$products = new WP_Query($product_args);?><?php if ($products->have_posts()) : $i = 1; ?><?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;query_posts(array('paged' => $paged)); while (have_posts()):the_post();?> <div class="threecol product<?php if($i % 4 == 0) { echo ' last'; } ?>"> <a href="<?php the_permalink(); ?>"> <h2 class="title"><?php the_title(); ?></h2> </a> <div class="product-image"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('product-image'); ?> </a> <?php if(function_exists('edd_price')) { ?> <div class="product-price"> <?php if(edd_has_variable_prices(get_the_ID())) { // if the download has variable prices, show the first one as a starting price echo 'Starting at: '; edd_price(get_the_ID()); } else { edd_price(get_the_ID()); } ?> </div><!--end .product-price--> <?php } ?> </div> <?php if(function_exists('edd_price')) { ?> <div class="product-buttons"> <?php if(!edd_has_variable_prices(get_the_ID())) { ?> <?php echo edd_get_purchase_link(get_the_ID(), 'Add to Cart', 'button'); ?> <a href="<?php the_permalink(); ?>">نمایش جزئیات</a> <?php } ?> </div><!--end .product-buttons--> <?php } ?> </div><!--end .product--> <?php $i+=1; ?><?php endwhile;?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }?> <div class="pagination"> <?php $big = 2; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, $current_page ), 'total' => $products->max_num_pages ) ); ?> </div><?php else : ?> <h2 class="center">پیدا نشد</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?><?php endif; ?></div><!--end .content--></div><!--end #main-content.row--><?php get_footer(); ?>اقا با این کد که کل چینش مطالب سایتم بهم ریخت تازه مطالب ناقص هم لود میشهاین روش فکر نکنم برای edd کاربرد داشته باشهلطفا دوستان کمک کنندمن خیلی گیر اینم!! نقل قول لینک به ارسال
asemon14 36 ارسال شده در بهمن 92 مالک گزارش بازنشر ارسال شده در بهمن 92 دوستان یعنی تو این اتجمن کسی نیس کمک کنه؟کسی اینو بلد نیس؟من یه چیزایی پیدا کردمولی نمیفهممش من از قالب استارتر خود edd استفاده کردم و گسترشش دادماینم ادرس خود قالبه که داری صفحه بندی هم هست:https://easydigitaldownloads.com/starter-theme/یکیش اینهhttps://github.com/pippinsplugins/EDD-Starter-Theme/issues/4یکی دیگهhttps://github.com/pippinsplugins/EDD-Starter-Theme/pull/5اینم موجوده ولی نمیدونم فرقش چیه و چه چیزی رو تو صفحه بندیش حل کردن:https://github.com/sumobi/EDD-Starter-Theme/commit/28ccebd4785b5c1c29f93b699bab55cc6af955e0 نقل قول لینک به ارسال
Parsa 23463 ارسال شده در بهمن 92 گزارش بازنشر ارسال شده در بهمن 92 اینکه بگید کسی بلد/آشنا نیست فقط باعث میشه دیگر جوابی به شما داده نشودقوانین را بخوانید 2 نقل قول لینک به ارسال
asemon14 36 ارسال شده در بهمن 92 مالک گزارش بازنشر ارسال شده در بهمن 92 اینکه بگید کسی بلد/آشنا نیست فقط باعث میشه دیگر جوابی به شما داده نشودقوانین را بخوانیدhttp://forum.wp-pars...دی/#entry116081ممنون از پاسخ گویی شماولی نمی دونم چطور خود به خود درست شدبازم ممنون نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .