css add class & extra padding to one php template

Posted on 2011-04-22
Last Modified: 2012-05-11
I would like to add 60 px right & left padding to this Wordpress category template page:

I don't want to adjust the container attribute because it will affect all of the pages, including the non-category template pages.

How do I add css and a style class to the attached blog-category.php file and css file to achieve additional 60 px padding on all blog category pages?  category-blog.php style-2-.css
Question by:carolsanjose
    1 Comment
    LVL 1

    Accepted Solution


    I'm not exactly sure now what do you mean. But I'm guessing you want to give padding to the entire content area? Did you already try to just add an extra wrap tags around the all of the content, for example:
    <?php get_header();?>
    <div class="category_wrap">
    	$WPS_sidebar		= $OPTION['wps_sidebar_option'];
    		case 'alignRight':
    			$the_float_class 	= 'narrow alignleft';
    		case 'alignLeft':
    			$the_float_class 	= 'narrow alignright';
    } else {$the_float_class 	= 'wide';}
    	<div class="<?php echo $the_float_class;?>">
    		while (have_posts()) : the_post();
    			include (TEMPLATEPATH . '/includes/category/blog-posts.php'); 	
    		include (TEMPLATEPATH . '/wp-pagenavi.php'); 
    		if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    	<?php if($OPTION['wps_blog_cat_sidebar_enable']){
    		include (TEMPLATEPATH . '/includes/category/blog-category-sidebar.php');     

    Open in new window

    And CSS for example:
    div.category_wrap {
        padding:0 60px 0 60px;

    Open in new window

    I haven't had a chance to test this, but I guess the principle would be the same though.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now