WordPress.org

Forums

How do I get these 2 tags to display inline (6 posts)

  1. Please Add Screenshots
    Member
    Posted 3 years ago #

    I've tried this...
    <span style="display:inline;"><?php single_tag_title(); ?> <?php the_category(); ?></small>

    but it doesn't work?

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    http://codex.wordpress.org/Function_Reference/single_tag_title
    http://codex.wordpress.org/Function_Reference/the_category

    there is nothing in the code of those functions, that would suggest that they would not display inline;

    might be caused by other styles in your theme;
    please post a link to your site to illustrate the problem.

  3. Please Add Screenshots
    Member
    Posted 3 years ago #

  4. Please Add Screenshots
    Member
    Posted 3 years ago #

    edit code..
    <small style="display:inline;"><?php single_tag_title(); ?> <?php the_category(); ?></small>
  5. alchymyth
    Forum Moderator
    Posted 3 years ago #

    my mistake - actually, 'the_category()' used without parameters outputs an unordered list;

    try to use:

    <?php the_category( ' ' ); ?>

    i.e.:

    <small style="display:inline;"><?php single_tag_title(); ?> <?php the_category(' '); ?></small>

  6. Please Add Screenshots
    Member
    Posted 3 years ago #

    Works a treat... many thanks (again).

    p.s I did look at the documentation prior to posting this, but as a code noob the examples were a bit basic... maybe extra examples would be useful :)

Topic Closed

This topic has been closed to new replies.

About this Topic