Community Forums › Forums › Archived Forums › Design Tips and Tricks › Author Box only on selected posts
Tagged: author box
- This topic has 7 replies, 3 voices, and was last updated 10 years, 7 months ago by maha.
-
AuthorPosts
-
May 3, 2014 at 9:51 am #103461mahaMember
I'm using News Pro and have activated Author Box that appears in all the single posts. At present there are 3 authors and on the Add New Post page I can select the author for a post from the dropdown provided. So far so good.
I now want an added option 'None' in the author name dropdown, so that I am able NOT to have the author box in selected posts.
How can I do this?
May 3, 2014 at 6:07 pm #103517Brad DaltonParticipantMay 3, 2014 at 11:14 pm #103550mahaMemberSorry for that. It's http://kolkatamusing.com/.
May 3, 2014 at 11:30 pm #103552Brad DaltonParticipantYou would need custom code for that as its built into genesis and there's no code supplied to add that option.
However, you could use this line to remove the author box conditionally however you would need to add each post i.d to the conditional tag in the code manually each time you want to exclude the author box on new posts.
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
May 4, 2014 at 8:52 am #103587mahaMemberThanks Brad. I was thinking if I could give those articles a special tag so that author bio doesn't appear in them. I guess this should work. However being a non-PHP I'm yet to get hold of code snippet to do this.
Btw, I tried to visit your site, but can't move in beyond homepage. It 'prohibits' me :{
May 4, 2014 at 10:41 am #103593SummerMemberThe way WordPress works, all posts/pages have to have an author. You can't get around the fact that each author has an ID number, and certain fields in many tables in WP rely on the author ID and the post ID. That's why when you delete a user from a site, it only gives you the option to either delete all that user's content entirely, or reassign that content to another user.
One option might be to assign the admin user as an author, and modify the user profile to not display the Author Box for that user.
Another option would be to create either another "dummy" account and use that (with Author Box disabled), or create an author role, one that isn't actually an account but that would show up as an author to assign to posts. The plugin Co-Authors Plus is excellent for this.
They will still show up in the byline, but you would be able to control whether the author box shows up or not.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkMay 4, 2014 at 2:50 pm #103618Brad DaltonParticipantHello @maha
Good idea with the tag as you can then use that in a custom function with conditional tag like this:
if ( has_tag( 'hide-author' ) ) remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
Note: You will need to write the rest of the code to complete the custom function as the above is simply a proof of concept and won't work on its own.
May 4, 2014 at 10:37 pm #103649mahaMemberThanks Summer, Brad for the inputs. I think I can now work a way out.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.