I want to edit the format of how posts are display only on the homepage of a Wordpress site but I can't seem to find which template it is that is being used. I'm using the Twentytwelve theme as a base to create a custom theme.

Also when I say the format, I don't mean the post format (ie. bold), I mean the style so changing things around and adding different CSS attributes to elements, that sort of thing.

Any help would be greatly appreciated.



Ah! Sorry about this.

It turns out after some further digging and playing around with the theme I figured out that the content.php file is what is being used.

To combat this though I changed the include to content-home and duplicated and renamed the content.php file and now it works. Easy way to alter the design of the homepage.


|improve this answer|||||

You can change the number showposts=35 as you want

$page_num = $paged;
if ($pagenum='') $pagenum =1;
query_posts('showposts=35&paged='.$page_num); ?>
        <?php if ( have_posts() ) : ?>
<div class"main">
<?php while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?>
        <?php else : ?>

            No Results

        <?php endif; ?>

EDIT: You can also change number of posts using something like this code in your functions.php First try this one:

 if ($query->is_home) {
            $query->set('posts_per_page', 35);
    return $query;

add_filter('pre_get_posts', 'number_of_posts_on_home');
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.