WordPress.org

Ready to get started?Download WordPress

Forums

Simple problem I just don't know how. (5 posts)

  1. chan-man
    Member
    Posted 1 year ago #

    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.

  2. glrss
    Member
    Posted 1 year ago #

    Your theme should make use of a single.php file that can be differently styled:

    http://codex.wordpress.org/Theme_Development

  3. chan-man
    Member
    Posted 1 year ago #

    let me check it out.

  4. chan-man
    Member
    Posted 1 year ago #

    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(); ?>
  5. chan-man
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic