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 1 year ago.

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

    Deluxe Designs
    Participant
    Post count: 3

    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
    #64439

    Sridhar Katakam
    Participant
    Post count: 1049

    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;
    }

    #64503

    Deluxe Designs
    Participant
    Post count: 3

    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.

    #64504

    Deluxe Designs
    Participant
    Post count: 3

    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.