• Hello,

    First of all, thank you for this nice and goodlooking template.

    I just wanted to customize a category.
    I created a file for this category “category-8”
    I modified my loop like beelow :

    <?php /* The loop */ ?>
    					<?php while ( have_posts() ) : the_post(); ?>
    					<div class="box_gs">
    						<a href="<?php the_permalink() ?>" rel="bookmark"></a>
    						<h2><?php the_title(); ?></h2>
    						<?php if (has_post_thumbnail()) {the_post_thumbnail('thumbnail');}?>
    						<?php the_excerpt(); ?>
    					</div>
    					<?php endwhile; ?>
    					<?php suits_paging_nav(); ?>
    					<?php endif; ?>

    I modified my css in “style” like beelow :

    .box_gs {
    	float:left;
    	width: 620px;
    	padding:5px;
    	margin:0 10px 10px 0;
    	background:transparent;
    	border-bottom-color: lightgrey;
    	border-bottom-style: solid;
    	border-bottom-width: 1px;
    }
    
    .box_gs img {
    float: left;
    margin: 0 10px 0 0;
    width : 80px;
    border-radius: 5px;
    
     }
    .box_gs h2 {
    	font-size:14px;
    	line-height:18px;
    	margin-bottom:5px;
    	margin-top:5px;
    }
    
    .box_gs a {
    color: black;
    
    }
    
    .box_gs:hover {
    background: lightgrey;
    }
    
    .box_gs .link  a{
    color:blue;
    float:right;
    }
    
    .archive-gs {
    	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    	margin-bottom: 20px;
    }

    Using Firebug I can see that the div exist but the css doesn’t apply.

    What did I miss ?
    Is their something in “functions” or “content” ?

    Thank you very much for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello!

    Could you please share a link to your site so I could take a look?

    Just as a friendly advice, you should never make any changes to your theme’s files. The best practice is to create a child theme, because this ensures that your modifications are not deleted when you update your theme or WordPress.

    [signature removed per forum etiquette]

    Thread Starter gabsej

    (@gabsej)

    Hello,

    Thank you for your answer.
    I can’t bring ou a link to the website, it’s on “maintenance” I stille have to create the content and to finish to define the layouts.

    You are right for the child layout, I did it but I will take attention to details, from what I red the “functions.php” file is working differently.
    It wasn’t too dangerous because my theme was working using “archives.php” I created a “category.php” to see my changes (and a copy for myself of ‘style.css, you are right, that’s not the best way).

    I found a trick to apply my modifications : I used “custom css” from the jetpack plugin but I’m still trying to understant why it doesn’t work by the other way.
    No idea !?

    That is a good way to apply css code also, but it applies to the page differently from when you paste it in the style.css (usually the css code from Jetpack’s plugin is linked last, so usually it has the highest priority)

    I think some of the code is being overwritten by something, but it is really hard to tell without seeing what happens (I use FireBug too ?? ). It may be some plugin, or some code of the theme that is interfering with your modifications.

    You should check if in the header.php file the <body> tag looks something like this:

    <body <?php body_class(); ?>>

    This will output some extra CSS IDs and classes to the body tag, which helps you create css code that applies only to specific pages.

    Please let me know how you manage.

    Cheers,
    Toth Balint BT [that is my username. What’s wrong with that?]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom class for a category page’ is closed to new replies.