Code Snippet
Insert Element Between Other Elements
For example, if you have five paragraphs in a row and you need to insert a break tag in between all of them. You can't put it before all five (you don't need one at the top) or after all five (you don't need one at the bottom), you only need four.
$("p:not(:last-of-type)").after("<br />");
This will also work..
$("p:not(:first-of-type)").before("");there’s supposed to be a break tag between those quotes.
:first-of-type is not a selector filter so the sinppent doesn’t work.
Here is the correction
$('.parent_of_target_p_tags').children('p.not(:last-child)').after('');
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.