Seperate Category Using Hooks – Possible?

Community Forums Forums Design Tips and Tricks Seperate Category Using Hooks – Possible?

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Deluxe Designs 2 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #64353

    Deluxe Designs

    I am working on a site here: 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!


    Sridhar Katakam

    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,
    .post-info {
        text-align: center;


    Deluxe Designs

    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.


    Deluxe Designs

    Aha! Display: block did it

    Thanks so much, once again.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.