• 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

Style post content for a category

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 › Style post content for a category

This topic is: resolved
  • This topic has 4 replies, 2 voices, and was last updated 12 years, 8 months ago by sheilab.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 20, 2013 at 5:23 pm #21829
    sheilab
    Participant

    How would I go about adding a div inside the content of single posts of a particular category?

    Can I do this from the functions.php file?

    Thanks.

    Sheila

    February 20, 2013 at 7:12 pm #21844
    Sridhar Katakam
    Participant

    1) (Not mandatory, but will make this easy) Install and activate Genesis Simple Hooks plugin.

    2) Go to Genesis -> Simple Hooks -> genesis_after_post_content Hook (Reference)

    Enter

    <?php if(is_single() && in_category( 'Cat A' )) { ?> <div id="my-custom-div">Hello hello.</div> <?php } ?>
    

    Change 'Cat A' to the name of your desired category and the div's content of course.

    Tick 'Execute PHP on this hook?'.


    Genesis Tutorials | Follow me on Twitter

    February 21, 2013 at 10:48 am #21989
    sheilab
    Participant

    Thanks for this! I now understand how to use Genesis Simple Hooks. Very useful. Unfortunately it turns out not to be what I need in this particular case.

    What I need is to format a category of single posts with a short-code initiated slideshow and a block of descriptive text sitting to its right.  The slide show and text need to be centered on the page. My client will be adding links etc to the descriptive text so it has to be added from the post editor.

    http://www.bergmanmediaservices.com/test-slideshow-page/

    Can you tell me the best way to go about this?

    Thanks again! Sheila

     

     

     

     

    February 22, 2013 at 2:38 am #22165
    Sridhar Katakam
    Participant

    Are all posts going to be like that or only some?

    Do you want two custom fields, one for slideshow shortcode and the other for corresponding text?

    Yesterday I made a post regarding showing value of a custom field above the content area that you might find useful. See http://websitesetuppro.com/how-to-show-a-custom-fields-value-at-the-top-of-every-post-or-page-in-genesis/


    Genesis Tutorials | Follow me on Twitter

    February 22, 2013 at 10:29 am #22250
    sheilab
    Participant

    Thank you!

    Your custom field post was very valuable. I installed ACF and drawing from you code I was able to use Simple Hooks to display the fields.

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