Adding multiple classes and id's

I’m building a wordpress website http://salafiwales.co.uk

On the blog I don’t mind all the info, date, time, comments etc on the page but on my " in store " page I have items posted and I do not want all the info on ech page. I have put the following css to get rid of it all: However I want to place all the post id’s for the items for the same rules ie postid-386 etc so how do I do this without creating rules for each class?

.postid-374 #sidebar {
display: none;
}
.postid-374 Content {
background: none;
}

.postid-374 #category-name {
display: none;
}

.postid-374 #reply-title {
display: none;
}

.postid-374 #comment {
display: none;
}

.postid-374 .form-allowed-tags {
display: none;
}

.postid-374 .form-submit {
display: none;
}

.postid-374 #comment {
display: none;
}

It’s not quite clear what you are asking, but you can group them together by separating them with commas. E.g.

.postid-374 .form-allowed-tags, .postid-374 .form-submit, .postid-374 #comment {
  display: none;
}

[ot]As an aside, though, this is dreadful web design—and a wonderful advertisement for not using WordPress. Using display: none to hide stuff is pretty lousy. Users still download all that junk, and think of poor blind users who may still have to trawl through all that stuff, and Google, too.

It would be preferable to use a better CMS, or at least find out how to head that code off ‘at the pass’, so to speak, and not let it into the HTML in the first place. [/ot]

I mean I have lots of postid’s that I want to apply the above rules to so how do I grounp those?

ie I have
postid-374
postid-389
postid-368
postid-360
postid-350

and for all of them I want to choose not to display the comments, post date etc etc

Again, a bit vague, but something like this:

.postid-374 #comments, .postid-389 #comments, .postid-368 #comments, .postid-360 #comments, .postid-350 #comments {
  display: none;
}

ok, this is the store page:

http://salafiwales.co.uk/?page_id=28

when you click on each item you are taken to it’s post and I want to remove the post dates, comments etc etc for each of those items…
so do I have to add each post id like this:

.postid-374 #comments, .postid-389 #comments, .postid-368 #comments, .postid-360 #comments, .postid-350 #comments {
display: none;
}

.postid-389 #comments, .postid-389 #comments, .postid-368 #comments, .postid-360 #comments, .postid-350 #comments {
display: none;
}

.postid-386 #comments, .postid-389 #comments, .postid-368 #comments, .postid-360 #comments, .postid-350 #comments {
display: none;
}

.postid-360 #comments, .postid-389 #comments, .postid-368 #comments, .postid-360 #comments, .postid-350 #comments {
display: none;
}

All but the first item in each of those blocks is the same, so no need to reapeat them over and over. Take the first item (before the comma) of each line, and the remaining ones of the first line, and that will do it:

.postid-374 #comments, .postid-389 #comments, .postid-386 #comments, .postid-360 #comments, .postid-389 #comments, .postid-368 #comments, .postid-360 #comments, .postid-350 #comments {
display: none;
}

But again, a better approach would be to go to the WP template and remove the comments on the pages that don’t need them.

lol I don’t know why it took me so long to get my head around that, but I got it now!!!

For each rule I placed all the postid’s like this:

.postid-374 #sidebar, .postid-389 #sidebar, .postid-386 #sidebar, .postid-360 #sidebar, .postid-389 #sidebar, .postid-368 #sidebar, .postid-360 #sidebar, .postid-350 #sidebar {
display: none;
}

.postid-374 #sidebar, .postid-389 #sidebar, .postid-386 #sidebar, .postid-360 #sidebar, .postid-389 #sidebar, .postid-368 #sidebar, .postid-360 #sidebar, .postid-350 #sidebar {
display: none;
}

.postid-374 Content, .postid-389 Content, .postid-386 Content, .postid-360 Content, .postid-389 Content, .postid-368 Content, .postid-360 Content, .postid-350 Content {
background: none;
}

.postid-374 .description, .postid-389 .description, .postid-386 .description, .postid-360 .description, .postid-389 .description, .postid-368 .description, .postid-360 .description, .postid-350 .description {
display: none;
}

.postid-374 #respond, .postid-389 #respond, .postid-386 #respond, .postid-360#respond, .postid-389 #respond, .postid-368 #respond, .postid-360 #respond, .postid-350 #respond {
display: none;
}

btw I have only ever used wordpresss, I do like it but what cms are you recommending?

[COLOR="#0000CD"].postid-374 #sidebar, .postid-389 #sidebar, .postid-386 #sidebar, .postid-360 #sidebar, .postid-389 #sidebar, .postid-368 #sidebar, .postid-360 #sidebar, .postid-350 #sidebar[/COLOR] {
display: none;
} 

[COLOR="#FF0000"].postid-374 #sidebar, .postid-389 #sidebar, .postid-386 #sidebar, .postid-360 #sidebar, .postid-389 #sidebar, .postid-368 #sidebar, .postid-360 #sidebar, .postid-350 #sidebar[/COLOR] {
display: none;
} 

Just note that you could simplify that further. You only need display: none once. E.g., you could group all those (minus the first item, which is a duplicate):

[COLOR="#0000CD"].postid-374 #sidebar, .postid-389 #sidebar, .postid-386 #sidebar, .postid-360 #sidebar, .postid-389 #sidebar, .postid-368 #sidebar, .postid-360 #sidebar, .postid-350 #sidebar[/COLOR], [COLOR="#FF0000"].postid-389 #sidebar, .postid-386 #sidebar, .postid-360 #sidebar, .postid-389 #sidebar, .postid-368 #sidebar, .postid-360 #sidebar, .postid-350 #sidebar[/COLOR] {
display: none;
} 

btw I have only ever used wordpresss, I do like it but what cms are you recommending?

WordPress is really a blog system rather than a CMS designed for your urposes (hence the #comments stuff everywhere, for example). There are lots of CMSes out there for regular sites, some free, some with a price. I recommend ExpressionEngine, but if you don’t want to pay for it, try Drupal, MODx, Concrete5, Textpattern, CMSMadeSimple and so on.

As an aside, though, this is dreadful web design—and a wonderful advertisement for not using WordPress.

WP is just a tool , like anything else using it the wrong way ( as the OP’er is ) is bound to have dreadful results.

Using display: none to hide stuff is pretty lousy.

Yup!

OP:

postid-374
postid-389
postid-368
postid-360
postid-350

This is where THINKING becomes all important…
Why? I there a pattern to the post/ comments/ meta info you want to ‘hide’. Do you really want to HIDE or you just don’t WANT IT TO BE OUTPUT at all? if the latter why are you using a WP template, settings, and theme which output and display this info. If you really just dont want certain posts AT ALL …Simply find post# 374,389, 368,360,350, and any other posts you dont want published and unpublish in the WP dashboard.

There are so manuy ways to do this am having trouble picking one to suggest. Let say you just don’t want those post to show up at all when a specific page template is used. Ok for that you actually have to code a line or two.

Go to the template file make an array to store the post you want to omit in this template ( or you could have a convoluted if statement later… but this is far more graceful)

<? $omitThese=array(374,368,etc,etc);?>

Then find the loop part of your template and add this line right after the while have_post() .

if (in_array($post->ID,$omitThese )){ continue;}

This way your post will be output in other templates , but not in the one ones you have made this alteration to.

I hope that gets you closer to making WP work the way you want it to

postid-374
postid-389
postid-368
postid-360
postid-350

*[class^=“postid-”] * {display: none;}

Hell on the parser, but Larry Wall did say laziness was a virtue. Having the back-end not send it in the first place as Dresden mentioned is way better of course, but CSS is starting to get a bit smarter. Some day it’ll finally have the full power of regex instead of these weak-@ssed wildcard things and then we’ll be rockin’.