CPT Author Box/Show Author Name

Posted in: Newspaper
Post count: 14

I know that under Theme Panel/Post Settings I can turn off both the ‘Show Author Name’ and ‘Show Author Box’ for all posts. However, I am wondering how I go about turning it off for just my Custom Post Types and leaving it active for my Posts.

Post count: 22421

Hi,
you can use css to do it but I will need to inspect your cpt if i’m to provide the code. I need the specific class of your post type so please provide a link to a post of this type so I can provide the code.
Thank you!

Post count: 14

Here is a link to one of the CPT

http://www.armchairallamericans.com/dev/player/lebron-james/

  • This reply was modified 10 years by drae.
Post count: 22421

Hi,
You can use this css to hide the author only for the “player” post type:
.single-player .td-post-author-name{
display:none!important;
}

If you also want to remove the date as well, you can add this code instead:
.single-player .td-module-meta-info{
display:none!important;
}

Thank you!

Post count: 14

Thanks for the help on this, but unfortunately it does not work. Please assist.

Post count: 22421

Hi,

You need to add the code in the theme panel – custom css box and make sure your previous tag is closed if you have any other code in there.
The code works as seen here: http://screencast.com/t/MajmvFXWGR
You might try to clear your cache as well after you add the code.

Thanks.

Post count: 14

Done, and it worked. Any reason why it doesn’t work when added to the child style.css?

Post count: 22421

Hi,

css usually should be inserted in the theme panel. If you have the child theme active, then it should also work from there. Please make sure you have the latest version of the child theme though (the one that comes with the theme package)

Thanks.

Post count: 14

Hi,

Recently I purchased this theme, could you please let me know how to hide Author name on the posts which admin posts, and show Author name on all other contributors post. For example admin will control all the ‘news’ posts which doesn’t need to show the author info, but for ‘Lifestyl’, ‘Health’, ‘Travel’ etc another guy is handling and he need to show his name on all the post which he posts.

Sorry for the complicated question, hope you understood what I need to do.

Thanks you

Post count: 22421

Hello,
Our theme has no such option unfortunately. It will have to be custom made. you can add an is_admin condition in every post template that you use on your site like so:

<?php if ( ! is_admin() ){
 echo $td_mod_single->get_author();
  }?>

Simply edit the loop-single files and replace the standard get_author function with the code provided.
http://screencast.com/t/mqkdLYbE
Thanks.

Post count: 9

Hi, i was looking for something similar and found this post.
what will be in case of theme update? the code will be replaced and you have to do the process again?

Post count: 22421

Hi,

Unfortunately, Yes as there is no update proof way of altering the theme files. You could use a child theme but even that is not update proof. You will still have to keep an eye out if the file was changed in an update and if it is, you will have to change it in the child theme as well, but it will spare you a couple of updates until we change the post files (they will not get changed too often hopefully)

Thank you!

Viewing 12 posts - 1 through 12 (of 12 total)
The forum ‘Newspaper’ is closed to new topics and replies.