I want to add a video icon / gallery icon next to title, which post contain video / photo gallery. Im on latest wordpress and making my own custom theme. Currently im using \[code\]<h3><a href="http://stackoverflow.com/questions/10563261/<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>\[/code\] for title. I was worked on another theme (not mine) before which have video icon on titles. The code i found in functions.php \[code\]<?phpfunction title_embed($title,$conts) { $pattern ="/<object> ?.* <\/object>/isx"; $return =preg_match($pattern, $conts,$result); if($result) { $return = $title.'<span class="video-icon"></span>'; return $return; } else{return $title;}
}\[/code\]which makes a span class on titles on posts contains \[code\]<object>\[/code\] and \[code\]</object>\[/code\]. The title code was \[code\]<a href="http://stackoverflow.com/questions/10563261/<?php echo $arraybox['link'][0];?>" title="<?php echo $arraybox['alt'][0];?>"><h2><?php echo $arraybox['title'][0];?></h2></a>\[/code\]I've tried pasting the above code to my current theme's functions.php but nothing happened. I think the problem may be the way I'm calling title. I've googled for a resource and wasted my 6-7 hours. thanks in advance,Haris
}\[/code\]which makes a span class on titles on posts contains \[code\]<object>\[/code\] and \[code\]</object>\[/code\]. The title code was \[code\]<a href="http://stackoverflow.com/questions/10563261/<?php echo $arraybox['link'][0];?>" title="<?php echo $arraybox['alt'][0];?>"><h2><?php echo $arraybox['title'][0];?></h2></a>\[/code\]I've tried pasting the above code to my current theme's functions.php but nothing happened. I think the problem may be the way I'm calling title. I've googled for a resource and wasted my 6-7 hours. thanks in advance,Haris