WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Post title + description on one line (4 posts)

  1. Kevin Kwok
    Member
    Posted 4 years ago #

    Hello! I am trying to display a category title and its description on one continuous line. I found in my functions.php where it generated the category title and description from.

    function gallery_page_title ($content) {
      if (is_category()) {
        $content = '<div class="page-title">';
        $content .= single_cat_title();
    	$content .= category_description();
      }

    Right now with that code it displays like this:

    TITLE
    DESCRIPTION

    BUT i want it to display like:

    TITLE - DESCRIPTION

    But i cant seem to figure out how =( please help if you can, thank you in advance!

  2. Kevin Kwok
    Member
    Posted 4 years ago #

    any takerS? =\

  3. Kevin Kwok
    Member
    Posted 4 years ago #

    I also just tried using this.. but same outcome

    <?php single_cat_title(); ?><?php echo category_description(); ?>

  4. Kevin Kwok
    Member
    Posted 4 years ago #

    solved my own question

    <?php
    foreach((get_the_category()) as $category) {
        echo $category->cat_name . ' '$category->description .' ';
    }
    ?>

    hehe....

Topic Closed

This topic has been closed to new replies.

About this Topic