Forums

Remove posted in 'category' from twenty eleven theme (23 posts)

  1. popsitivity
    Member
    Posted 5 months ago #

    ola.
    I'm using a child theme based on Twenty Eleven.
    I'd like to remove the categories information shown in post footer.
    I'd like to remove it from all post formats.

    I spent a few hours looking for a tip in wp forum but did not find a working solution.
    Hope that some of you can help me.

  2. ChristiNi
    Member
    Posted 5 months ago #

    Hi popsitivity,

    To remove that line add this to your Child Theme's style sheet (style.css):

    .entry-meta
    {
    display:none;
    }

    Hope this helps!

  3. popsitivity
    Member
    Posted 5 months ago #

    i tried with with it but doesn't work. where do i have to put it in style.css? i tried just adding it at the end but, as i said, nothing changed.

  4. ChristiNi
    Member
    Posted 5 months ago #

    Hello again popsitivity,

    Can you give us a link to your website? Perhaps something is different about your Child Theme and that element has a different class. Also, once you made the change, did you refresh the page in your browser? You may also want to clear your browser cache to make sure you are not viewing a cached version of your site.

    Thanks!

  5. popsitivity
    Member
    Posted 5 months ago #

    ok. i tried again and it worked. but it removed all informations. i would like to keep posted on 'date' visible and just hide posted in 'category'.
    can i prevent date from being hidden?

  6. popsitivity
    Member
    Posted 5 months ago #

    i would post you my blog link but i uploaded an 'undercostruction' page via a plugin, while working on it.

  7. Chip Bennett
    Member
    Posted 5 months ago #

    Try targeting the .entry-utility-prep-cat-links class:

    .entry-utility-prep-cat-links {
        display:none;
    }
  8. ChristiNi
    Member
    Posted 5 months ago #

    Hello again popsitivity,

    I tested this and this is the solution I found to remove just this line from your home page:

    Posted in [category] | Leave a reply

    And this line from the single post view:

    This entry was posted in [category] by [author]. Bookmark the permalink.

    .cat-links,
    footer.entry-meta
    {
    display:none;
    }

    I also found this post that shows other ways to modify these lines:

    http://wordpress.org/support/topic/edit-twenty-eleven-11-theme?replies=18

    Hope this helps!

  9. popsitivity
    Member
    Posted 5 months ago #

    i can't see the first line i have to remove from my homepage.
    and wich is the homepage file?

    do i have to remove this:

    .cat-links,
    footer.entry-meta
    {
    display:none;
    }

    from content-single.php
    or single.php?

  10. ChristiNi
    Member
    Posted 5 months ago #

    Hello positivity,

    I'm sorry my previous instructions weren't clear. Add the following to your Child Theme's style sheet:

    .cat-links,
    footer.entry-meta
    {
    display:none;
    }

    The link I provided to the other post is another way of removing the text you want to remove. So, it's really up to you, you can either add the CSS (above) to the style sheet, or edit the template files. If you choose to edit the template files:

    • for single posts, edit content-single.php
    • for the home page, edit content.php.

    Hope this helps!

  11. popsitivity
    Member
    Posted 5 months ago #

    is there a specific line of my child theme style.css file i shoul add it to?
    sorry if asking a lot, but it would be really good to handle how to display only date.

    thanks.

  12. ChristiNi
    Member
    Posted 5 months ago #

    Hello popsitivity,

    You should be able to just add that to the end of your style sheet. Let me know how this goes for you please.

  13. popsitivity
    Member
    Posted 5 months ago #

    nope.
    is your code colliding with this

    }
    .entry-meta
    {
    display:none;
    }

    which is the last part of my content section in style.css?

    i tried to add it at thend of style.css, nothing changed.
    i tried to attach your lines after it (nothing happened) and at its place (both informations, category and date, come back on my blog after posts.)

  14. ChristiNi
    Member
    Posted 5 months ago #

    Hi popsitivity,

    I'm sorry if you're still having trouble with this. If you are using a Child Theme, your Child Theme's style sheet should have started out looking something like this:

    /*
    Theme Name: Twentyeleven Child
    Description: Child theme for the twentyeleven theme
    Author: Your name here
    Template: twentyeleven
    */
    
    @import url("../twentyeleven/style.css");

    If you've previously added other styles, they would be listed after the @import line.

    If you haven't already, remove this from your style sheet:

    .entry-meta
    {
    display:none;
    }

    Hope this helps!

  15. popsitivity
    Member
    Posted 5 months ago #

    yuppie!
    got it.
    thank you ChristiNi.
    you've been really kind.

  16. ChristiNi
    Member
    Posted 5 months ago #

    Fantastic popsitivity!

    I'm happy I could help! If you have time, please mark this topic as resolved.

    Thanks!

  17. popsitivity
    Member
    Posted 5 months ago #

    ...
    it works only on some posts..
    not all of them.

  18. ChristiNi
    Member
    Posted 5 months ago #

    Hi popsitivity,

    I'm sorry that's not working for you. Are you using special templates for some of your posts? Have you tried taking a look at the posts with the Firebug extension in Firefox or Chrome? I'm sorry, but without a link to see what you're seeing, it's hard to pinpoint what the issue might be. Could you take a screen shot of where this isn't working?

    Thanks!

  19. pactrop
    Member
    Posted 4 months ago #

    Thanks ChristiNi.

    It worked great for me!

  20. ChristiNi
    Member
    Posted 4 months ago #

    Glad to hear that pactrop, thanks for the feedback!

  21. hjustice
    Member
    Posted 3 months ago #

    ChristiNi - thank you. I have been trying to change this today with little success. Luckily I searched for help again and found this posting. I already had a child theme with my own css file so your solution was super simple and effective. Plus easy to show others! Thanks again!

  22. Digital Raindrops
    Member
    Posted 3 months ago #

    Another solution is to copy content.php from twenty eleven to your child theme and add a line to clear the variable that holds the categories, css or code both work.

    With the code you could have categories on the categories or archive pages, by saving content.php as content-archive.php and/or content-categories.php

    Find:

    <?php
    	/* translators: used between list items, there is a space after the comma */
    	$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    	if ( $categories_list ):
    ?>

    Then add a line to empty the $categories_list

    <?php
    	/* translators: used between list items, there is a space after the comma */
    	$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    	$categories_list = ''; /* Empty the Variable */
    	if ( $categories_list ):
    ?>

    HTH

    David

  23. pajamagirl
    Member
    Posted 3 months ago #

    Thank you so much, ChristiNi - I have been looking for days, and your solution is simple and perfect. Thank you!

Reply

You must log in to post.

About this Topic