• Hi everyone !

    I’m trying to change some things in WP theme I bought, and I have to admit that my knowlage about PHP is low :/

    Under every blog post title I have post-meta div with basic meta data as Time , user and number of comments. I want to add category data as well. So I’ve made some changes in post-meta.php and it looks now:

    <div class="post-meta">
    
    <time datetime="<?php the_time('Y-m-d\TH:i'); ?>"> <?php the_time('d-m-Y'); ?></time>
    
    <?php the_author_posts_link() ?>
    
    <?php comments_popup_link('0', '1', '%', 'comments-link', 'Comments are closed'); ?>
    
    <strong><?php the_category(',') ?></strong>
    
    </div><!--.post-meta-->
    		<?php } ?>

    Post Category is now visible but i’ve noticed that befor name,time and comments is small icon so i want to make that icon for category as well.
    I already have icon grapihic and I found proper CSS file responsible for that:

    .post-meta time,
    	.comment-meta time {
    		background-image:url(../images/meta-icon1.png);
    	}
    	.post-meta a[rel="author"],
    	.comment-meta .author {
    		background-image:url(../images/meta-icon2.png);
    	}
    	.post-meta .comments-link {
    		background-image:url(../images/meta-icon3.png);
    	}
    	.post-meta .category {
    		background-image:url(../images/meta-icon4.png);
    	}

    I’ve tried some combinations but i dont know how to add that css element to:
    ‘ <?php the_category(‘,’) ?> ‘

    Can anyone help me with that ?

    Big Thanks in advance!

  • The topic ‘Add css style to post-meta element’ is closed to new replies.