• Hello,

    i got confused completely… my wp website shows my posts list on a static page (not as home page). I would like to custom the posts on this page but not on their single pages.

    I use twentyeleven child theme. My idea was to create a custom template, then i added a class (.custom-post) to the #content in this template, so i could have styled the .hentry divs on this custom templated page something like this (it is just an example) :

    <?php
    /**
     * Template Name: All Products
     * The template for displaying all pages.
     *
     * @package WordPress
     * @subpackage Mondial Or
     * @since Mondial Or 1.0
     */
    
    get_header(); ?>
    
    <div id="primary">
    	<div id="content" class="post-custom" role="main">
    
    			<?php the_post(); ?>
    
    			<?php get_template_part( 'content', 'page' ); ?>
    
    			<?php comments_template( '', false ); ?>
    
    	</div><!-- #content -->
    
        <?php get_sidebar(); ?> 
    
    </div><!-- #primary -->
    
    <?php get_footer(); ?>

    And in the CSS :

    .custom-post .hentry {
    display: inline-block;
    width: 30%;
    }

    In this case the post will be styled only on the posts list page but not on its single page… but the class does not appeare, checked by firebug.

    Any idea how to do (or the same way or differently) what i want ?

The topic ‘How to custom posts on a page’ is closed to new replies.