• 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

How to add category name in 'post info'

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 › How to add category name in 'post info'

This topic is: not resolved

Tagged: .post-info, customization, Magazine Pro, php

  • This topic has 6 replies, 3 voices, and was last updated 8 years, 6 months ago by Ritesh Verma.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • January 3, 2014 at 11:54 pm #83061
    Ritesh Verma
    Member

    Hi Guys,

    I need a bit of help regarding 'post info'.

    Presently my post info stands as : Date, author, comments (December 7, 2013 by Ritesh Verma 2 Comments)

    i wish to add category as well to it. like :<date> by <author> in <category> <comments>. It just need to be category name here rather then showing whole lot of string attachs with it like 'posted in : <category name>

    i tried a few snippets available on studioPress (SP) and other freely available resource on net. Unfortunately worked as per my goal. What closest i went was using shortcode present in simple edits plugin.
    <date> by <author>
    posted in <category>
    <comment> (edit)

    Eg : December 7, 2013 by Ritesh Verma
    Posted in : SEO
    2 Comments (Edit)

    i need all this in 1 line without any other text explanatory text attached with it. like [December 7, 2013 by Ritesh Verma in SEO 2 Comments

    http://studypep.com/
    January 4, 2014 at 5:26 am #83088
    Brad Dalton
    Participant

    Try this http://wpsites.net/web-design/3-ways-to-move-post-meta-below-post-info/


    Recent Client work

    January 4, 2014 at 6:04 am #83093
    Ritesh Verma
    Member

    Thanks Brad,

    I have already tried 'your' codes of wpsites before i post this question here. what i expect is removal of "filed under" present before category name and place category name right beside author name in same line.

    You can check the image to know what i am expecting to happen and what's really going on.

    http://s11.postimg.org/4qne04sj7/Untitled7.jpg

    January 4, 2014 at 10:05 am #83138
    Brad Dalton
    Participant

    The solution is in the post i linked to.

    Remove what you need from the filter including Filed under and add what you want and it will modify the default output in your post info or meta.

    Please note: Using PHP code with a filter that is already included in a plugin like Genesis Simple Edits may not work so try de-activating the plugin if you have it installed.


    Recent Client work

    January 4, 2014 at 10:46 am #83155
    Ritesh Verma
    Member

    May be brad i am going wrong some where. This is what i have pasted from your site.

    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    add_filter( 'genesis_post_info', 'sp_post_info_filter', 12 );
    function sp_post_info_filter($post_info) {
    $post_info = '[post_date] by [post_author_posts_link] in [post_categories] [post_comments] [post_edit]';
    return $post_info;
    }
    January 21, 2014 at 3:23 pm #86321
    sandy018
    Member

    I have same issue can anyone please explain.

    January 21, 2014 at 9:26 pm #86386
    Ritesh Verma
    Member

    Hello Sandy,

    After searching all resource available on net, I don't think its possible what we are expecting. Every webmaster have shared one & the same thing; although few came up with different approaches to do it but end product is not satisfactory.

    Following resource available on net we will get :

    Date : XX/XX/XXXX By: Author
    Category : XXXXXX
    Leave a comment.

    Where as it should be like : <b>Date : XX/XX/XXX By XXXXXX In <category name>. Leave comment (Edit).<b>

    So sandy either you can use codes i pasted above; but will have all info in 3 different line or let it be in default setting if you want them to accommodate in one single line itself.

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

© 2022 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