Conditionally remove author box from posts by category

Homepage Community Forums Epik Theme Support Conditionally remove author box from posts by category

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #12349
    Willingham
    Customer

      Hello,

      Wonder how I might remove the author box on posts for specific categories.

      Thanks ๐Ÿ™‚

      Site is at http://claireburge.com

      #12374
      Eric
      Customer

        I would add display: none; in your css to the .author-box….but if you only want it on certain categories, then try adding the name of that category in front of it. Example, if your category is called “creativity” then do it like this –

        .creativity .author-box {
            display: none;
        }

        That will work if your category shows up in your source code as a class. If it shows up as an ID then you’d need to add the ID instead.


        I create awesome sites for awesome people! Contact me if interested โ€“ ericsanchez1585@gmail.com

        #12380
        Willingham
        Customer

          Thanks Eric. Seemed like that might work… And yes, the goal is to remove the author box only for certain categories.

          I tried it with the category name, but it didn’t remove the author box from posts in that category. So, if I would want to try it by category ID, can you tell me how I might structure the CSS to properly identify the category ID? (The ID is 20, but identifying it simply by .20 didn’t do the trick either.)

          Thanks. ๐Ÿ™‚

          #12410
          Eric
          Customer

            Ahh I just realized the category code doesn’t show up on the pages/posts themselves, but only on the blog category pages…so what I mentioned above won’t really work for what you’re trying to do. It would if Genesis added the category of the post in the source code, but it doesn’t so there’s no way to link to it.


            I create awesome sites for awesome people! Contact me if interested โ€“ ericsanchez1585@gmail.com

            #12427
            Willingham
            Customer

              Makes sense. Was worth a shot, though. ๐Ÿ™‚

              Seems like there should be a way to add a condition to functions.php (thinking this snippet http://my.studiopress.com/snippets/author-box/), but I don’t write php. If you have any thoughts on that, would appreciate it, otherwise I’ll keep looking around.

              Thanks much. ๐Ÿ™‚

              #12446
              Eric
              Customer

                Yeah I’d keep looking around to see what options are out there because I haven’t seen anything in the StudioPress documentation that would explain how to do it – http://my.studiopress.com/snippets/


                I create awesome sites for awesome people! Contact me if interested โ€“ ericsanchez1585@gmail.com

                #13574
                Steve
                Customer

                  I found an answer to this from StudioPress.

                  This code removes the “author box” (genesis_post_info) from the whole site:

                  remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );

                  You could always add a condition (this would go in your functions.php file):

                  /** Remove Post Info */
                  if (is_category('Category Name'))
                    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
                Viewing 7 posts - 1 through 7 (of 7 total)
                • You must be logged in to reply to this topic.