Theme Support Forum

Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums

Viewing 12 posts - 1 through 12 (of 12 total)

Displaying tags from a post on the front page

Home Forums Free Theme Support Triton Lite Displaying tags from a post on the front page

  • #27242

    Elizabeth

    Hello,

    I would like the tag from a post to appear on the front page where the picture is, on the same line that the date is, but on the left, always showing, not just when hovering.

    Thank you in advance for your help!

    #27424

    Towfiq I.

    administrator

    Open up layout1.php and replace this(appears 3 times):

    <div class="date_meta"><?php the_time('d'); ?>. <?php the_time('m'); ?>. <?php the_time('Y'); ?></div>

    with this:

    <div class="tag_meta"><?php the_tags(); ?></div>

    then add this to the very bottom of your stylesheet:

    .tag_meta{padding:3px 10px; background:rgba(0, 0, 0, 0.4); position:absolute; right:0; top:10px;}

    #31492

    Elizabeth

    Hi Towfiq,

    That works great, except the date disappeared altogether. Any ideas on how to restore that?

    Thanks.

    #31493

    Towfiq I.

    administrator

    thats what you wanted right? you wanted to display tags in place of date?

    #31504

    Elizabeth

    Update:
    instead of replacing <div class=”date_meta”><?php the_time(‘d’); ?>. <?php the_time(‘m’); ?>. <?php the_time(‘Y’); ?></div> with <div class=”tag_meta”><?php the_tags(); ?></div> , I added the second line in front of the first line. In my stylesheet I added margin-right: 180px; I’m not sure that this is the way to do it, but it seems to work.

    The problem now is that I can’t style the font (the tags are in blue with an underline) and the word “tags:” appears, which I don’t want. Any ideas?

    All your help is much appreciated !

    #31505

    Towfiq I.

    administrator

    yes, its a valid way to do this. Add this to your stylesheet to fix the text color of the tags:

    .tag_meta a{color:#fff; text-decoration:none;}

    #31507

    Elizabeth

    Oops, I just read your comment….no I didn’t want the date to disappear, I just wanted to add the tag on the same line.

    #31509

    Elizabeth

    Thanks, that fixed the blue underline issue. Any ideas on getting rid of “tags:” ?

    #31510

    Towfiq I.

    administrator

    replace this:

    <?php the_tags(); ?>

    with this:

    <?php the_tags( ' ', ', ', '); ?>

    #31513

    Elizabeth

    I did that on all three lines and everything from the slider down disappeared. Was I supposed to do it only on one of the lines?

    #31550

    Towfiq I.

    administrator

    sorry, replace this:

    <?php the_tags( ' ', ', ', '); ?>

    with this:

    <?php the_tags( ' ', ', ', ''); ?>

    #31677

    Elizabeth

    Perfect! It looks awesome! Thanks for your help.