Give help. Get help.

  • # February 8, 2013 at 4:09 pm

    I am having an issue. Every page on my website is a different color (on purpose). But I want all of my portfolio pages to use the same CSS. Here is my current HTML code for header.php:

    Now, with my current PHP code, each page can be specified in my CSS my typing .page-pagename, but I do not want to type out each individual page from my portfolio drop-down:


    Like so (for every darn CSS property). I know there has to be an easier way to do this. Is there someway I could target my portfolio li items all in one sweep? Currently, my CSS is simply using .page-portfolio, but a physical portfolio page does not actually exist. It is simply a place holder for whatever I have to do to make this work.

    Thank you in advance. You guys have always been there for me…no matter how stupid the question.

    Edit: Is it something as simple as making every li class the same name?

    # February 8, 2013 at 4:27 pm

    I don’t understand. You’re listing a menu and then a list of classes that aren’t related to each other.

    What are you trying to target here? Whole pages or just the styling the menu?

    If it’s just the menu, you can do this:

    .header-portfolio li { /* styles */ }

    # February 8, 2013 at 5:24 pm

    Do you have a link? Do the pages share any classnames on the body that are unique to those pages?

    # February 8, 2013 at 7:23 pm

    After adding that function to your functions.php file, when you go to any page you’ll see its parent’s slug as a class on the ``. In your case, that class is `parent-slug-portfolio`.

    # February 8, 2013 at 7:43 pm

    I went to the page and inspected it with Chrome’s Inspector and looked at all of the classes being applied to the body.

    # February 9, 2013 at 2:50 am

    Firebug and Inspector are virtually the same for these purposes.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.