Need help? Check out our Support site, then


Eliminate metadata for one post only?

  1. boschpackagingpharmana
    Member

    I wonder if someone has a solution for this. I would love to eliminate the metadata (date, tags, categories, author) for just one post. Specifically, I want to make a post sticky, eliminated the metatdata for that post only, and use the sticky post as sort of an extension of my top navigation.

    Is this possible?

    Thanks!

    The blog I need help with is boschpharma-blog.com.

  2. Yes, it's possible. For example, this will remove the metadata from your October 9 post:

    .post-3459 .post-metadata {
        display: none;
    }
  3. boschpackagingpharmana
    Member

    That is awesome! Thank you so much! Quick question. I can get the post number by mousing over a post in my post list and looking at the status bar below. Is this the best way?

  4. You're welcome.
    Yes, that's one of the ways you can use. A good alternative is to examine your page using a developer extension.
    And, on second thought, you don't even need to look for the ID number of the post, if it's a sticky. Use this:

    .sticky .post-metadata {
        display: none;
    }
  5. boschpackagingpharmana
    Member

    Also a cool option. As long as I'm at it, is there a CSS tag to eliminate an individual post's (or sticky post's) title as well? Normally I just wouldn't type one, but sticky posts highlight the title, so without a title they leave a blank line of highlighting...

  6. On Tarski, the metadata and the title (highlighted or not) are both inside a div classed ".post-meta". So, to remove metadata plus title plus highlighting, don't use my previous suggestion, use this:

    .sticky .post-meta {
    	display: none;
    }
  7. boschpackagingpharmana
    Member

    Awesome. Thanks a lot!

  8. boschpackagingpharmana
    Member

    One more question, my idea works, but there is way too much spacing before and after the sticky post. Is there some css code that will make the upper and lower padding go away, as well as remove the bottom border? I only want to do this for the one sticky post.

  9. Yes, but you need to add the sticky so we can see it.

  10. boschpackagingpharmana
    Member

    Sorry -- of course. I am not really ready to publish my idea though, so I just made one of my posts sticky so you can see it. But, I put the meta back in because I don't want it missing from this particular post.

  11. Try this, and decrease the 3em:

    .sticky {
        border: 0 none;
        margin-bottom: 3em;
        padding-bottom: 0;
    }
  12. boschpackagingpharmana
    Member

    This didn't have any affect...

  13. Then try it this way:

    .sticky {
        border: 0 none !important;
        margin-bottom: 3em !important;
        padding-bottom: 0 !important;
    }
  14. boschpackagingpharmana
    Member

    That did the trick! But now I have to ask, how did the use of the syntax "important" affect the rendering of the code?

  15. You had added some CSS to style all the posts, using a peculiar selector (#primary .entry), and apparently this selector overrides the one I used for the sticky. Adding the "!important" tag reverses this.

    When I checked the temporary sticky, I saw that the top of its content was aligned with the top of the sidebar, so I thought that no change to the upper padding was needed. But things are different now. To reduce the gap between the menu and the image, add this:

    .home #content {
        padding-top: 0;
    }
    .home #secondary {
        padding-top: 2em;
    }

    (This shows that's it's always better to let us see or know exactly what you want to do when you ask questions. This is true for other reasons too: if you had told me what you were looking for, I would have suggested a simpler and more effective way of doing it, namely a background image to the menu.)

  16. boschpackagingpharmana
    Member

    This all works really great. I appreciate the help. I noticed with the syntax you provided, I can reduce the value in

    .home #secondary {
    padding-top: 2em;
    }

    to 0, which is actually preferable. But this syntax is only being applied to the main page of the blog. Category archive pages move the sidebar back down again. Is there a way to get around that? I tried applying the same syntax using .category, but it doesn't respond.

  17. First you need to remove the negative margins you've specified: some browsers render them correctly and some don't, so in some browsers the appearance isn't the one you intended.

    You've added this:

    #navigation {
        border-bottom: 0 solid #738EB5;
        border-color: #738EB5;
        margin-bottom: -2em;
    }

    Turn the -2em to just 0 (and remove the border-color line, as it's superfluous).

    You've added these two:

    .post-9 {
        border: 0 none !important;
        margin-bottom: -0.8em !important;
        padding-bottom: 0 !important;
    }
    .sticky {
        border: 0 none !important;
        margin-bottom: -0.8em !important;
        padding-bottom: 0 !important;
    }

    These are redundant. Keep the one of the two, and turn the -0.8em to 0.

    By the way, I also noticed you've turned the blog title and tagline to white. That's not the right way to remove them. Do you need that extra space and the border below the header image or not?

  18. boschpackagingpharmana
    Member

    I don't need the extra space. I turned them white because I want them on the page still for search engine visibility.

  19. boschpackagingpharmana
    Member

    I think I got rid of all the unnecessary stuff out of the CSS now. I still am hoping to learn how I can raise the sidebar on all pages, rather than just home. I haven't had any luck experimenting with that...

    Thanks in advance for any assistance.

  20. The sections called primary (= posts column) and secondary (= sidebar) are enclosed in the section called content. Primary and secondary have no top-padding, content has a 2em top padding. So, to move the sticky closer to the menu, I removed the top padding from .home #content, and added it to .home #secondary to compensate (that is, make sure the positioning of the sidebar remained as on the rest of your pages). That's why your ".category #secondary {padding-top: 0;}" has no effect: the selector is correct, but the top padding is already 0 on all pages except the homepage.

    Now, moving the sidebar higher is possible, of course, but I don't see why you want this. You really mean you want the top of the searchbox to touch the grey border? That's not reasonable, is it?

    As for the blog title and tagline, first delete these:

    #blog-title {
        background-color: #FFFFFF;
        color: #FFFFFF;
        font-size: 10pt;
    }
    #tagline {
        background-color: #FFFFFF;
        color: #FFFFFF;
        font-size: 10pt;
    }

    To remove the title, the tagline and the useless space but keep the border below them, add this:
    #blog-title, #tagline {
    display: none;
    }
    To remove the title, the tagline, the useless space and the border, don't add the above, just turn this:

    #title {
        border-bottom: 1px solid #738EB5;
        border-color: #738EB5;
    }

    to this:

    #title {
        display: none;
    }

    And don't worry about search engine visibility: search engines don't read what human visitors see on your actual page, they read the sourcecode of your page; specifying "display: none" removes the element from the former but not from the latter.

  21. boschpackagingpharmana
    Member

    Thank you for all your help. I am really pleased with the look now.
    I hate to treat this forum topic as a catch-all, but you have been so much help. I can't seem to get WordPress to accept a new picture for my URL icon (rather than the WordPress logo). Any ideas?

    Thanks again!

  22. You're welcome.
    I'm not seeing the W logo in the address bar, I'm seeing a grey icon (the same one you've got in your header).

  23. boschpackagingpharmana
    Member

    Yes, it seems to be changed now. It just took some time. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic