cornell2 0 Report post Posted August 23, 2011 I'm not sure this is a general coding question or one specific to PlatformPro ... I have a "boxes" page, that, for example, displays 6 boxes... 3 on the top row and 3 underneath. for the sake of the question, let's call them fbox_11, fbox_12, fbox_13 fbox_21, fbox_22, fbox_23, (note these are not intended to refer to the absolute anchor IDs (yet) OK. it's easy to write custom code to, for instance, change the background color or border for several of the boxes. Buttttt ... WHAT IF - I ALWAYS want to make the middle boxes yellow and, and the upper right boxes, blue. Positionally. In other words, I can't merely write custom css to change the colors of specific boxes - just whatever one happens to land 2nd, 3rd, 5th. I may rearrange boxes in with "reorder boxes", for instance. I still want the 2nd and 5th box on that page to be yellow background. So my question is more about writing code for "relative" boxes. BTW - the formatting I gave above is just for an example - it's not the problem I am trying to solve - it's the positional reference. For the moment, I have a page with some very funky box formatting and layout. Every time I add a new box (from Add-Boxes) I want the content to shift... so yesterday's upper left is now today's middle left box - and the formatting of the page does not change. Right now I am doing it with custom css referencing specific boxes and manually changing the code every time a new box is added. In real terms ... my custom css for, say, the center box in the top row is: #fbox_1486 .fboxinfo {width: 370px; background:blue; border:1px solid black;} of course this modifies the content of post type=box, with "post id" of 1146. No matter if it is the 1st box or 20th on the page, the content in this box/post will always look the same. I want it to matter. If I add a new box before box-1146 (in the list), then the position of the content of box 1146 shifts, but the formatting follows it. (which is normal expected behavior) What I want is the content in 1146 to take on the formatting of the next box-position now. so the revised code instead might be something like #fbox .secondbox .fboxinfo {width: 370px; background:blue; border:1px solid black;} #fbox .thirdbox .fboxinfo {width: 100px; background:yellow; border:1px solid black;} (I am making this up of course). I honestly don't know how to get this to work with just one set of custom css that I don't have to revise every time I add new content. I hope I explained this in such a way that you can visualize in general what I want to do. It's actually a simpler explanation with a few illustrations. If I made this sound totally confusing, I'll attempt to restate it using some kind of illustration. Any Ideas? Thanks! PS - I know one straightforward answer (but hard work) is probably to create a style sheet or child page ... but umm... I'd like to avoid this for now since it's not only a chore, I'd be bound to break a whole lot of other things in the process. ; ) Share this post Link to post Share on other sites
kastelic 6 Report post Posted August 23, 2011 Paste one of these lines of jQuery into Custom Code -> Footerscripts (not both): [code] jQuery('.fbox:even').css('background','blue'); jQuery('.fbox:odd').css('background','blue'); [/code] which will make the even or odd ones with a background of blue. If you need to get more specific you can use the "nth-child" rule Share this post Link to post Share on other sites
cornell2 0 Report post Posted August 23, 2011 oooohhh... cool. I was not on the "external library" thought process. Yes, I definitely see it (and I might as well use some other cool Jquery stuff). Unfortunately I never really used Jquery within wordpress,let alone on top of someone's platform. Hope it works 'out of the box' because I wouldn't know where to begin to debug it in wordpress. Thanks - I guess it was obvious I was struggling to describe a function that i might have subconsciously seen many times but never had the occasion to use ... An incredible answer in 45 mins ... the people in this forum are great ... Thanks ! Share this post Link to post Share on other sites