Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

display more products on page Emporium Theme Tempatic WordPress

  • SOLVED

Hi,

How can I display more products on my pages? There are only 10 per page, then you have to click 1,2,3,4, button to see more. I would like either to have more, or, all per category so when someone clicks "tops" for example all of my tops show up on one page (and you don't have to go to the next page). Thanks in advance.

Answers (2)

2011-04-22

Pippin Williamson answers:

Go to 'Settings" -> 'Reading' and change the number of posts to be displayed from 10 to whatever you want.

Or, if you want to modify it in your template, you can add "posts_per_page=15" to query_posts()


saint merc comments:

Thanks for the fast reply

I went to settings and that worked great, just wondering now in which template
for the second option, I tried in "Archives Page Page Template" no go.
Can you be a little more detailed on how and where.

Thanks again.


<div id="post-<?php the_ID(); ?>" >
<div class="arclist box">
<ul>
<?php query_posts('shoepost=60'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<div class="archives-time">
<?php the_time('M j Y') ?>
</div>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a> - <?php echo $post->comment_count ?> </li>
<?php endwhile; endif; ?>


Pippin Williamson comments:

To modify the code that you gave me, it would look like this:

<div id="post-<?php the_ID(); ?>" >
<div class="arclist box">
<ul>
<?php query_posts('shoepost=60&posts_per_page=15'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<div class="archives-time">
<?php the_time('M j Y') ?>
</div>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a> - <?php echo $post->comment_count ?> </li>
<?php endwhile; endif; ?>


Then just change "15" to however many you want to display. "-1" will display all posts.


saint merc comments:

Tried again, and its not working in the script. Could it be in another place?


<?php
/*
Template Name: Archives Page
*/
?>
<?php get_header(); ?>

<div id="page" class="clearfix">

<div class="breadcrumb clearfix">
<?php if ( get_option( 'ptthemes_breadcrumbs' )) { yoast_breadcrumb('',''); } ?>
</div> <!-- breadcrumbs #end -->


<div id="content">


<h1 class="head"><?php the_title(); ?></h1>


<div id="post-<?php the_ID(); ?>" >
<div class="arclist box">
<ul>
<?php query_posts('showpost=60&posts_per_page=40'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<div class="archives-time">
<?php the_time('M j Y') ?>
</div>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a> - <?php echo $post->comment_count ?> </li>
<?php endwhile; endif; ?>
</ul>
</div>
<!--/arclist -->
</div>
<!--/post -->

</div> <!-- content #end -->
<?php get_sidebar(); ?>
</div> <!-- page #end -->

<?php get_footer(); ?>


Pippin Williamson comments:

Do you have an index.php or blog.php, or possibly home.php?

Try those files.


saint merc comments:

This is what I got


404 Template
(404.php)
Archives
(archive.php)
Archives Page Page Template
(page-archives.php)
Comments
(comments.php)
Contact Us Page Template
(page_contact.php)
Footer
(footer.php)
Header
(header.php)
Main Index Template
(index.php)

Page Template
(page.php)
Product Listing Page Page Template
(tags.php)
Search Form
(searchform.php)
Search Results
(search.php)
Sidebar
(sidebar.php)
Single Post
(single.php)
Store Page Page Template
(store.php)
Theme Functions
(functions.php)
auto_install.php
(auto_install.php)
comments-old.php
(comments-old.php)
delete_data.php
(delete_data.php)
message.php
(message.php)
product_menu.php
(product_menu.php)
thumb.php
(thumb.php)
upload.php
(upload.php)
Styles
Stylesheet
(style.css)
custom.css
(custom.css)


Pippin Williamson comments:

Most likely index.php

If that doesn't work, try one at a time until you find it.


saint merc comments:

This is the index script can't find "query_posts" what am i looking for in this script?


<?php
$action = $_GET['img'];
?>
<?php if (function_exists('wp_email_capture_form')) { wp_email_capture_form(); } ?>

<head>

<link href="style/style.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">
<!--
function toggle(o){
var e = document.getElementById(o);
e.style.display = (e.style.display == 'none') ? 'block' : 'none';
}

function goform()
{
if(document.forms.ajaxupload.myfile.value==""){
alert('Please choose an image');
return;
}

document.ajaxupload.submit();
}
function goUpload(){

if(document.forms.ajaxupload.myfile.value==""){
return;
}


document.getElementById('f1_upload_process').style.visibility = 'visible';
document.getElementById('f1_upload_process').style.display = '';
document.getElementById('f1_upload_success').style.display = 'none';
//document.getElementById('f1_upload_form').style.visibility = 'hidden';
return true;
}

function noUpload(success, path, imgNumb){
var result = '';
if (success == 1){
document.getElementById('f1_upload_process').style.display = 'none';
var theImage = parent.document.getElementById(imgNumb);
theImage.value = path;
document.getElementById('myfile').value = '';
document.getElementById('f1_upload_success').style.display = '';

//parent.toggle(imgNumb + "_div");
// parent.reloadFrame(imgNumb + "frame");
// document.getElementById('f1_upload_form').style.display = 'none';
}
else {
document.getElementById('f1_upload_process').style.display = 'none';
document.getElementById('f1_upload_form').style.display = 'none';
document.getElementById('no_upload_form').style.display = '';
}
return true;
}

//-->
</script>
</head>



<style>

#upload_target
{
width: 100%;
height: 80px;
text-align: center;
border: none;
background-color: #642864;
margin: 0px auto;
}

</style>




<body>
<form name="ajaxupload" action="<?php echo "upload.php?img=".$action."&nonce=".$_GET['nonce']; ?>" method="post" enctype="multipart/form-data" target="upload_target" onSubmit="goUpload();" >
<p id="f1_upload_process" style="margin-top: 20px;">Uploading Please wait ...<br/><img src="loader.gif" /><br/></p>
<div id="f1_upload_form" align="left"><!--Select Image You want to upload:-->
<table border="0" cellpadding="0" cellspacing="0"><tr><td><label><input name="myfile" id="myfile" class="textboxStyled" type="file" size="50" onChange="goform();goUpload();" tabindex="2" /></label>
<p id="f1_upload_success" style="display:none; font-weight:bold;">Uploaded Successfully<br></p>
</td><td><!--<a href="javascript: goform()" onClick="goUpload();" tabindex="2"><input type="button"; name="Upload" value="Upload"></a>--></td></tr></table>
</div>

<iframe id="upload_target" name="upload_target" src="#" style="width:0;height:0; border:0; background:#eee;" ></iframe>
</form>
<div id="yesupload" style="display: none;"><center><?php echo mkt_ADMIN_OPTIONS_UPLOAD_LOGO_SUCCESSFUL; ?></br><a href="#" onlcick="reload(<?php echo $_GET['img']; ?>)"><?php echo mkt_ADMIN_OPTIONS_UPLOAD_LOGO_DIFFERENT_IMG; ?></a></center></div>

</body>


Pippin Williamson comments:

It's going to be a file with a query_posts.

2011-04-23

David Navarrete answers:

if is a page try with this query_posts

<?php query_posts('post_type=page&showpost=60&posts_per_page=15'); ?>


saint merc comments:

Hi thanks for trying, but it only seems to work with going to 'Settings" -> 'Reading' , but I'd prefer to change it in one of the scripts if possible. Let me know if you can help.


David Navarrete comments:

you known what file must edit? else give me the link of you web


saint merc comments:

some one said to look for query_posts i found it in file "Archives Page Page Template" but i'm not certain thats right and i also found it in "Store Page Page Template" (store.php) that connects to the view store button on my front page i already changed. what other info can i give u the website is www.sweetcitygirl.com


David Navarrete comments:

give me the specific link where you would change de number of productos


saint merc comments:

give me an example i'm not sure i understand what you need i load my pic in media>library and i add my products in "post>add products"


David Navarrete comments:

ex: http://www.sweetcitygirl.com/?category_name=dresses this page show 15 products, where show 10 products?


David Navarrete comments:

open store.php if dont have a query_posts function.

after of loop write this
<?php global $query_string; query_posts("$query_string&showposts=15"); ?>


saint merc comments:

Its because I changed them all to 15 in 'Settings" -> 'Reading' (they were all 10's before). So, I'm looking to know in which script I can make this change be 100 or more?


David Navarrete comments:

the script store.php have query_posts? if dont have put the code up


saint merc comments:

yes it has i post it up


saint merc comments:

<?php
/*
Template Name: Store Page
*/
?>
<?php get_header(); ?>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/js/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){

$("a.switch_thumb").toggle(function(){
$(this).addClass("swap");
$("ul.display").fadeOut("fast", function() {
$(this).fadeIn("fast").removeClass("thumb_view");
});
}, function () {
$(this).removeClass("swap");
$("ul.display").fadeOut("fast", function() {
$(this).fadeIn("fast").addClass("thumb_view");
});
});

});
</script>
<div id="page" class="container_100 clearfix">
<div class="breadcrumb clearfix">
<?php if ( get_option( 'ptthemes_breadcrumbs' )) { yoast_breadcrumb('', ' &raquo; ' . $_GET['page']); } ?>
</div> <!-- breadcrumbs #end -->
<div id="content" class="full_width">
<h1 class="head"><?php _e('store');?></h1>
<?php
$totalpost_count = 0;
$limit = 1000;
$blogCategoryIdStr = str_replace(',',',-',get_inc_categories("cat_exclude_"));
query_posts('showposts=60&posts_per_page=100' . $limit . '&cat='.$blogCategoryIdStr);
if(have_posts())
{
while(have_posts())
{
the_post();
$totalpost_count++;
}
}
//echo $totalpost_count;
$limit = 200; // number of posts per page for store page

$posts_per_page_homepage = $limit;
global $paged;
$blogCategoryIdStr = str_replace(',',',-',get_inc_categories("cat_exclude_"));
query_posts('showpost=60&posts_per_page=200'. $limit . '&paged=' . $paged .'&cat='.$blogCategoryIdStr);
?>
<?php
if(have_posts())
{
?>

<a href="#" class="switch_thumb swap"><?php _e('Switch View');?></a>
<ul style="display: block;" class="display thumb_view">
<?php
$postcounter = 0;
while(have_posts())
{
the_post();
$postcounter++;
$data = get_post_meta( $post->ID, 'key', true );
$product_price = $Product->get_product_price($post->ID);
?>
<li>
<div class="content_block"> <a href="<?php the_permalink() ?>" class="product_thumb"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo $data[ 'productimage' ]; ?>&amp;w=161&amp;zc=1&amp;q=80<?php echo $thumb_url;?>" alt="<?php echo get_the_title($post->ID); ?>" /></a>
<?php
if($Product->get_product_price_sale($post->ID)>0)
{
?>
<img src="<?php bloginfo('template_directory'); ?>/images/sale.png" alt="" class="sale_img" />
<?php
}else
{
?>
<?php
}
?>
<div class="content">
<h3><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a></h3>
<p class="contentp"><?php echo bm_better_excerpt(600, ' ... '); ?></p>
<p class="sale_price" >
<?php
if($Product->get_product_price_sale($post->ID)>0)
{
echo ''.$General->get_amount_format($Product->get_product_price_only($post->ID)).'&nbsp;';
echo ''.$General->get_amount_format($Product->get_product_price_sale($post->ID)).'';

}else
{
if($General->is_storetype_catalog())
{
if($Product->get_product_price_only($post->ID)>0)
{
echo $General->get_amount_format($Product->get_product_price_only($post->ID));
}
}else
{
echo $General->get_amount_format($Product->get_product_price_only($post->ID));
}
}
?>
</p>
<div class="viewdetails"> <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>" class="b_viewdetails fl"><?php _e('View Details');?> &raquo;</a> </div>
</div>
</div>
<!-- content block #end -->
</li>
<?php
if($postcounter%5==0)
{
echo '<li class="product_sepretor"></li>';
}
?>
<?php
}
?>
</ul>
<div class="clearfix"></div>
<?php
}
?>

<div class="pagination">
<div class="Navi">
<?php if (function_exists('wp_pagenavi')) { ?>
<?php wp_pagenavi(); ?>
<?php } ?>
</div>
</div>
<?php
global $Cart,$General;
$itemsInCartCount = $Cart->cartCount();
$cartAmount = $Cart->getCartAmt();
?>
</div> <!-- content #end -->
</div> <!-- page #end -->
<?php get_footer(); ?>
<!-- sidebar #end -->


David Navarrete comments:

change

query_posts('showposts=60&posts_per_page=100' . $limit . '&cat='.$blogCategoryIdStr);


for

query_posts('showposts=60&showposts=15' . $limit . '&cat='.$blogCategoryIdStr);