I’m developing a site in which a great many posts are commented notifications of new, authored topics on various remote sites, and which need no author box or even ‘by author’ tags in the posts on my site. However, a number of in-depth posts are/will be authored ‘locally’ and should have author name and author box attached to post.
Is it possible to switch off name and box in the theme template, then switch a theme ‘on’ only for a few individual posts?
(switching name and box ‘on’ in theme template, then switching ‘off’ with custom css per postid would require far too much custom css work!)
Regards,
Alan
Hi,
If those special posts would be included in a particular category, this would be possible with a simple CSS code. For example I don’t want display the author name and author box for posts in the “Gadgets” category. This would be the simplest solution to remove the author name an author box
– https://www.screencast.com/t/4YBv3eHGSbW
– https://www.screencast.com/t/tQRV2CsKis85
This is the code used in the example, replace the category name with the one in your case and make some tests to see if it works properly.
.single .category-gadgets .td-post-author-name,
.single .category-gadgets .author-box-wrap {
display:none;
}
Thanks
Hi Simion,
Thanks for your prompt and helpful reply. I can assign a category for my ‘external-pointing’ articles, use custom CSS to switch off the author box for posts with his category, then hopefully I’ll be able to use custom CSS to hide the category header itself in the post (a needless distraction).
Problem solved!
Alan
Oops. My enthusiasm was premature, Simion. The CSS you suggest only works when the category-gadgets (to use your example) is included in the page build. Thus, if I select the category ‘category-gadgets’,from my sidebar, a page builds with only ‘category-gadget posts, and the css includes the style classes ‘.single .category-gadgets .(etc) ‘ so the {display:none} works.
But on a more general listing of posts that does not specify the ‘category-gadgets’ category, then {display:none} doesn’t work. (Though it works just fine if I remove ‘category-gadgets’ and my CSS reads .single. author-box-wrap { display:none; }. Which of course turns off all the author boxes and defeats the entire purpose.)
Do You have any other ideas, or are we stuck here?
Regards,
Alan