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

  1. chan-man
    Posted 3 years 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
    Posted 3 years ago #

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


  3. chan-man
    Posted 3 years ago #

    let me check it out.

  4. chan-man
    Posted 3 years 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(); ?>
    	<!-- /#content -->
    <?php endwhile; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  5. chan-man
    Posted 3 years 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