• currently, i’m having my content editors wrap the content in every page entry with a <div class="legal"></div>

    how do code things so the editors will not have to type <div class="legal"></div> on every page entry?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Edit page.php if its for pages, and add it where you want it…. most likely before and after the_content

    Thread Starter sergibosch

    (@sergibosch)

    Let’s drill a bit deeper into this concept if you will. (btw, thanks Rev Voodoo for your earlier reply)

    What if I want to add a class to an <ul> (or any html content for that matter) that appears in the_content

    Do I need to write a php function or variable to do so?

    thanks!

    If you don’t need a different class for each

      .. you can just style it in your css

    eg:
    div.legal ul { your style here }

    Thread Starter sergibosch

    (@sergibosch)

    hi, supervee

    yeah, i’m comfortable using css, particularly pseudo selectors, to target the content. and i’m pretty comfortable using jQuery to add a dynamic class.

    i’m really stumped on how to add a class using PHP though.

    I guess my question is .. why do you need to do this?

    Thread Starter sergibosch

    (@sergibosch)

    Hi, supervee

    the designers made a design that includes a scrolling div nested amongst other divs. it could appear at any point during the_content.

    to make the div scroll, i attach a class to that div, which is associated to a jQuery plugin (jScrollPane).

    i don’t have the option of asking the copy editors to add a class to a div. (forget the ul i referred to earlier, it needs to be a div).

    hopefully somebody will see this that knows how to pull it off using PHP.

    thanks anyway, supervee. i appreciate your interest in the problem.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how do i dynamically add a div class to all entries’ is closed to new replies.