Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to add category name in 'post info'
Tagged: .post-info, customization, Magazine Pro, php
- This topic has 6 replies, 3 voices, and was last updated 11 years ago by
Ritesh Verma.
-
AuthorPosts
-
January 3, 2014 at 11:54 pm #83061
Ritesh Verma
MemberHi 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 #83088Brad Dalton
ParticipantJanuary 4, 2014 at 6:04 am #83093Ritesh Verma
MemberThanks 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.
January 4, 2014 at 10:05 am #83138Brad Dalton
ParticipantThe 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.
January 4, 2014 at 10:46 am #83155Ritesh Verma
MemberMay 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 #86321sandy018
MemberI have same issue can anyone please explain.
January 21, 2014 at 9:26 pm #86386Ritesh Verma
MemberHello 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.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.