I think the best way to approach this is jump straight in and explain as I go.
I am using wordpess with a custom made template (we made it) this code is to deal with the twitter widget pro. (this isn't the prettiest of code granted, I will clean it up later)
<?php
/*
* TWITTER SIDE BAR
*
* Sets the twitter area to display: none and pulls in the content from the server
* Javascript then does a string replace to remove a bit of unwanted text
* finally javascript will write the doctored string to the client browser
*/
?><div id="twitterRight">
<ul class="xoxo" style="list-style-type:none; font-size:11px; margin:0px 20px 0 0;">
<li id="twitter-2" class="widget-container widget_twitter">
<div id="twitHold" style="display:none;">
<h3 class="widget-title"><span class='twitterwidget twitterwidget-title'><a href="http://www.twitter.com/username" target="_blank"><img src="<?php echo home_url(); ?>/images/twitterName.png" width="208" height="27" alt="EhomeS" /></a></span></h3>
<ul>
<?php
$twitter = dynamic_sidebar('primary-widget-area');
?></ul>
</div>
<div id="twitHolder">
<script type="text/javascript">
// Get the posted content from the server
var str = $('#twitHold').html();
var x = str.replace("Twitter: @username", "");
//var shortString = x.substr( 0, 10 );
document.write(x);
</script>
</div>
</li></ul>
</div><!-- END #twitterRight -->
The problem is the wordpress function dynamic_sidebar doesn't return a string or anything, only a boolean value so I cannot manipulate that. So what I have done is stored the outputted HTML in a js variable x and manipulated it from there.
What I am trying to achieve is to simply limit the number of characters in each list item (tweets) however I cannot find a way of doing so. I have tried this so far with no luck (im thinking because the javascript is writing it out and parsing it, im not sure).
Is there a way to perform the substr on the list items?