• 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

Seperate Category Using Hooks – Possible?

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 › Seperate Category Using Hooks – Possible?

This topic is: not resolved

Tagged: category, functions, php

  • This topic has 3 replies, 2 voices, and was last updated 11 years, 7 months ago by Deluxe Designs.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 26, 2013 at 1:49 pm #64353
    Deluxe Designs
    Member

    I am working on a site here: http://www.brunetteanthem.com and have the category above the post title using position: absolute

    Depending on the length of the category, it is not always centered and the client would like it centered. Right now I am just using margins but it is not exact, consistently enough. What I would like to do is hook the category above the post title in functions but I am unsure how to go about writing the function. I really, really don't want to do it in CSS because there does not appear to be a way to do it totally centered.

    I was told this is a custom code... which I totally understand... but I am just sure it can be done without too, too much trouble!

    Thanks.

    http://www.brunetteanthem.com
    September 27, 2013 at 2:21 am #64439
    Sridhar Katakam
    Participant

    Add this in functions.php:

    add_action( 'genesis_post_title', 'sk_show_categories', 9 );
    
    function sk_show_categories() {
    	echo do_shortcode('[post_categories before=""]');
    }

    and this in style.css:

    .entry .categories,
    .entry-title,
    .post-info {
        text-align: center;
    }

    Genesis Tutorials | Follow me on Twitter

    September 27, 2013 at 1:27 pm #64503
    Deluxe Designs
    Member

    Amazing, thank you!!!! So that worked to get the category separated and added above the post title. The CSS did not work, however. I will keep fiddling around but if you have any suggestions, I'd be interested.

    September 27, 2013 at 1:28 pm #64504
    Deluxe Designs
    Member

    Aha! Display: block did it

    Thanks so much, once again.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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