• Hi, nice theme, Anders

    I wonder if it is possible to show the posts “category” at the preview page, maybe instead of the number of comments

    Thanks in advance

    Nacho

Viewing 1 replies (of 1 total)
  • katalonian

    (@katalonian)

    Hey, Nacho.

    Perhaps it’s a bit late (10 months ^_^), but it can be useful to someone else looking for the same answer.

    Here is my solution:

    Add to the content.php just before <h2 class=”post-title”>

    <?php if ( is_front_page() ) { ?>
    <h3 class="post-category"> <?php the_category(''); ?> </h3>
    <?php } ?>

    Add to the end of style.css this:

    /* show category */
    
    	.post-category {
    		background: #CA2017;
    		border-radius: 60px;
    		font-size: 13px;
    		color: #ffffff;
    		height: 25px;
       	 	padding: 7px 16px 18px 16px;
        	margin-bottom: 14px;
        	display: inline-block;
    
    	}
    	.post-category a {
    		color: #ffffff;
    	}
    	.post-category a:hover {
    		color: #ffffff;
    
    	}

    Hope that will be helpful 😉

Viewing 1 replies (of 1 total)
  • The topic ‘Add category at the preview page’ is closed to new replies.