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

AUTOFOCUS PRO - Limit # of images on home page WordPress

  • SOLVED

I would like to only display 8 posts thumbnails on the homepage with a pagination for the rest but keeping the same layout.

Answers (2)

2011-04-10

Duncan O'Neill answers:

HI again queenb,

the file you need to edit is in the autofocuspro folder. From there go to the extensions directory, and find the file thematic-functions.php.

Around line 311 in my local version, you'll find something similar to this;


<?php query_posts(array(
'post__not_in' => get_option('sticky_posts'),
'caller_get_posts' => 1,
'cat' => '-'.$af_blog_catid,
'paged' => $paged,
'showposts'=>4, // dbo change 6-4-11
)); ?>

<?php } //end sticky post check ?>

<?php query_posts(array(
'post__not_in' => get_option('sticky_posts'),
'caller_get_posts' => 1,
'cat' => '-'.$af_blog_catid,
'exclude' => $postno,
'paged' => $paged,
'showposts'=>4,// dbo change 6-4-11
)); ?>


You only to need to edit / add the one line, which is the one which begins 'showposts'. Add that if it's not already there, and change the figure to 8 instead of 4.

Please email me if this /doesn't/ work.

best,

Duncan


queenb comments:

Hi Duncan,

Thanks for all your help. I added the following and it only displays the last 8 posts which is what i wanted:


'showposts'=>8,// dbo change 6-4-11

However, it doesnt't give me a pagination to see the older ones. Any ideas?


Duncan O'Neill comments:

Do you have a paged paramater, as in the above code, in the array?


queenb comments:

Yes, I have the following:
<!-- #sticky-feature -->

<?php } //end featured sliding option check ?>

<?php query_posts(array(
'post__not_in' => get_option('sticky_posts'),
'ignore_sticky_posts' => 1,
'cat' => '-'.$af_blog_catid,
'paged' => $paged,
'showposts'=>8,// dbo change 6-4-11
)); ?>

<?php } //end sticky post check ?>

<?php query_posts(array(
'post__not_in' => get_option('sticky_posts'),
'ignore_sticky_posts' => 1,
'cat' => '-'.$af_blog_catid,
'exclude' => $postno,
'paged' => $paged,
'showposts'=>8,// dbo change 6-4-11
)); ?>


Duncan O'Neill comments:

Sorry queenb, some more questions;

1) Does the following update to the code above work? Add the second line in both instances above...

'showposts'=>8, // dbo change 6-4-11
'posts_per_page'=>8,


If not;
2) Which version of autofocus(+)(pro) are you using please?
3) Do you have the slider enabled on the front page?
4) Were the next / previous arrows showing up before you made the changes above?

best,

Duncan


Duncan O'Neill comments:

Queenb,

in fact, on further testing, try *replacing*


'showposts'=>4,


with


'posts_per_page'=>4,


sorry about the sloppiness there.

best,

Duncan


Duncan O'Neill comments:

That should of course be, 'posts_per_page'=>4,.


Duncan O'Neill comments:

arrrgghh! :-) 'posts_per_page'=>8,


queenb comments:

Hi Duncan,

I think I realize why it doesn't show my navigation. In a previous question I asked how to remove the big arrows and just have "previous post" and "next post " under the single post content (you can see it at the end of the file).

I deleted it and reuploaded it but it only showed me the arrows in the single post and not the homepage.

I've attached the thematic-functions.php


Duncan O'Neill comments:

Hi queenb,

Um, I can't see attachment, sorry.

Are you sure the homepage arrows weren't hidden via css rather than via thematic-functions.php?

It might be quicker to either get an address for your site, or FTP access.

best,

Duncan




queenb comments:

I actually reverted the functions.php back and it worked! Thanks for your help...again.

2011-04-10

AdamGold answers:

Try putting this in your CSS:
.entry-meta img {
width: 250px;
height: 300px;
}


if it doesn't work, try adding / changing this in functions.php:
add_image_size( 'archive-thumbnail', 250, 300, true ); // Archives thumbnail size
Not sure if it's 'archive-thumbnail' thought, so please post here your index.php file.


AdamGold comments:

You edited your question, can you re-explain your self please?


queenb comments:

That didn't work but I found that I had to edit a css style on a different file.


queenb comments:

I was editing the question at the same time you answered. I wanted to change the size of the thumbs on the first page but figure it out. I just had to change the dimensions in portfolio-layout.css.

I wanted also to add text but realized that there was a widget above the footer. Since the answer was not found i edited the question for another.


AdamGold comments:

Use Duncan O'Neill for the query_posts, but you will have to insert the following block of code where ever you would like the "next" and "previous" to show:

<?php next_post_link('%link', 'Next'); ?>
<?php previous_post_link('%link', 'Back'); ?>