WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] post title & post content in one line (7 posts)

  1. sgchauhan
    Member
    Posted 5 years ago #

    is it possible to have the post title & post content in one line? e.g. title : content

    i have tried editing the index.php and the stylesheet (entry) but with no luck.

    thanks in advance.

  2. SimonJ
    Member
    Posted 5 years ago #

    Yes, it's totally possible. Put the title and author tag on one line :

    <?php the_title(); ?> <?php the_author(); ?

    Make sure you don't have these codes wrap in different header tags (<h1>, <h2>, etc.).

    Your best bet would be to fit them in the same div or the same header.

    Something like :

    <h2><?php the_title(); ?>&nbsp;<?php the_author(); ?</h2>

    You can give a class to to h2 to style it as you want :

    <h2 class="title_and_author"><?php the_title(); ?>&nbsp;<?php the_author(); ?</h2>

    S.

  3. sgchauhan
    Member
    Posted 5 years ago #


  4. sgchauhan
    Member
    Posted 5 years ago #

    this is what i am using

    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> : <class="entry"><?php the_content('Read the rest of this entry &raquo;'); ?>

    i tried to do what you said but it still didnt work. any other thoughts?

  5. sgchauhan
    Member
    Posted 5 years ago #

    figured it out.

    changed <?php the_content('Read the rest of this entry &raquo;'); ?>

    to <?php echo get_the_content(); ?>

  6. asechrest
    Member
    Posted 5 years ago #

    I believe the_content() automatically wraps the post content in <p> tags and that's why you couldn't get it to work. But I'm not sure.

  7. SimonJ
    Member
    Posted 5 years ago #

    Oh, sorry! I misreaded you! I readed "the title" and "the author"...

    Sorry.

    S.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.