public
Created

Stack overflow answers

  • Download Gist
h2_span1stw.htm
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var obj_h2 = $('h2');
var h2_title = obj_h2.html();
var words = h2_title.split(' ');
words[0] = '<span>' + words[0] + '</span>'
obj_h2.html( words.join( ' ' ) );
});
</script>
<style type="text/css">
h2 span{
color:red;
}
</style>
</head>
<body>
<h2>Converted post title</h2>
</body>
</html>
h2_span1stw_2.htm
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('h2.title').each( function (){
var obj_h2 = $(this);
var h2_title = obj_h2.html();
var words = h2_title.split(' ');
words[0] = '<span>' + words[0] + '</span>'
obj_h2.html( words.join( ' ' ) );
} );
});
</script>
<style type="text/css">
h2.title span{
color:red;
}
</style>
</head>
<body>
<h2 class="title">Converted post title</h2>
<h2 class="title">Title #2</h2>
<h2 class="title">This is H3 #3</h2>
</body>
</html>
redirect_1.htaccess
1
RedirectMatch 301 ^/(site1|site2|category1)(/.*|$) /$1-new$2

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.