• Resolved venkman

    (@venkman)


    i’m customising the classic theme.. implementing it in to a template page i made up that’s the same as the rest of my website.

    i’m trying to get the date and post title on the same line.

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_date('','<h2>','</h2>'); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    	 <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>

    i’d imagine i could just move the date onto the same line as the storytitle but it doesn’t work. i tried a few different things and searched the forum – but found no resolution. probably real simple though, thanks in advance ??

    <div class="post" id="post-<?php the_ID(); ?>">
    	 <h3 class="storytitle"><?php the_date('','<h2>','</h2>'); ?><a href="<?php
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter venkman

    (@venkman)

    ba bumP ^

    Thread Starter venkman

    (@venkman)

    bumP ^

    Thread Starter venkman

    (@venkman)

    really guys, have a look here please…

    even with no css styles at all if i have the the code:

    <div class="post" id="post-<?php the_ID(); ?>">
    	 <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?><?php the_date('','<h2>','</h2>'); ?></a></h3>

    the date only goes after the story title – not on the ame line. so if i put the date and time – which i take it is the code inclusnd the <?php ?> brackets:

    <?php the_date('','<h2>','</h2>'); ?>

    before the h3 tag, in the link or after the < a > link it gos on a new line.

    i don’t understand how there is any formatting on there (the date became blue when placed within the < a > tag which makes sense, but from where is it getting the idea to start a new line? and also where does the default formatting come from?

    i have a fair idea of css and html bu perhaps im missing something in using the php here.. please have a look and see if you can help. thanks very much.

    venk.

    I might be off a bit, but this might be helpful anyway.

    <h1>, <h2> etc. are block level elements, so they will not be placed inline by default.

    A simple way to go about this would be to replace your <h3> and <h2> tags with <span class="yourclassname">, <span> being an inline element, and style your text accordingly.

    If you’d like to keep your mark-up semantically correct by using h2 etc, you’d need to play around with float: left; or display: inline; kind of stuff.

    Thread Starter venkman

    (@venkman)

    hey mendezki, thanks for the reply. it was to do with the ‘h’ tags, i’ll use css to format the text.

    i also found the reason the two were being forced onto different lines was i should have deleted everything out the date php brackets so it was simply:

    <?php the_date(); ?>

    cheers! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘date title on the same line’ is closed to new replies.