WordPress.org

Support

Support » How-To and Troubleshooting » Simple problem I just don't know how.

Simple problem I just don't know how.

  • I want to style the posts on my blog but when i click a post and it goes to the posts specific page I want to style it another way. So basically I want the posts list to have a specific class that doesn’t apply to the posts specific page. If you don’t get what i’m taking about i’m sure I can explain it another way.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your theme should make use of a single.php file that can be differently styled:

    http://codex.wordpress.org/Theme_Development

    let me check it out.

    I have the file open but i don’t know what to change. Here is whats in my file single.php:

    <?php get_header(); ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    
    	<div id="content" class="list-post">
    
    		<?php // get loop.php ?>
    		<?php get_template_part( 'includes/loop' , 'single'); ?>
    
    		<?php wp_link_pages(array('before' => '<p><strong>'.__('Pages:','themify').'</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    		<?php // get post-nav.php (next/prev post link) ?>
    		<?php get_template_part( 'includes/post-nav'); ?>
    
    		<?php // get comment template (comments.php) ?>
    		<?php comments_template(); ?>
    
    	</div>
    	<!-- /#content -->
    
    <?php endwhile; ?>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    I figured out that if I change this line of code:
    <article id="post-<?php the_ID(); ?>" <?php post_class("post clearfix $class"); ?>>

    in the loop.php file to this this:

    <article id="post-<?php the_ID(); ?>" class="yardsale-post" <?php post_class("post clearfix $class"); ?>>

    it works just right.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Simple problem I just don't know how.’ is closed to new replies.
Skip to toolbar