• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Show post category in post excerpt?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Show post category in post excerpt?

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 11 years, 1 month ago by Fabio.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 26, 2014 at 12:02 pm #96777
    Fabio
    Participant

    Hi there,
    I was wondering what I should do to display post category in excerpt like they do here:
    http://www.hongkiat.com/blog/
    as you can see the first word of each post is the category in a blue rectangle: inspiration, tools, photoshop and other.

    How do you achieve that?
    Thanks

    Fabio

    April 2, 2014 at 5:47 am #98035
    cruisegle
    Member

    On my new blog I have removed post and page titles from the loop as I wanted them in the right header.

    I am then using the PHP Code Widget plugin and adding the following code into the widget which is placed in the right header widget area.

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php if (is_front_page()) { ?>
    <h1>Most of Marketing is Totally Bollocks;<br> I’m an SEO Consultant...</h1>
    <?php } elseif (is_page()) { ?>
    <h1><?php the_title(); ?></h1>
    <?php } elseif (is_tag()) { ?>
    Posts Tagged as <h1><?php single_tag_title(); ?></h1>
    <?php } elseif (is_day()) { ?>
    <h1>Talking Bollocks on <?php the_time('jS F Y'); ?></h1>
    <?php } elseif (is_category()) { ?>
    Posts marked as <h1><?php single_cat_title() ?></h1>
    <?php } elseif (is_single()) { ?>
    <h1><?php the_title(); ?></h1>
    <?php } ?>

    So I guess you could use <?php single_cat_title() ?> somehow within an archive template.


    I’m an SEO Consultant by trade; who is getting by; just!

    April 4, 2014 at 2:43 pm #98519
    Fabio
    Participant

    Thanks mate,
    for some reason I didn't get an email notification with your reply. I just logged in now and I saw it.
    You got a nice blog as well, must be from the UK... they always say bollocks over here...

    Anyways, I appreciate your suggestion but honestly I don't know how to act upon it, so it doesn't matter, I guess I'll need to hire somebody.

    Thanks
    Fabio

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble