js_escape – why nothing?
-
I want to use a nice javascript “ticker” for “news” on my main site. Unfortunately, the nice looking one “ballistic” needs text in 1 line. I thought of trying to modify it with the approach of “proHTML ticker”, but that looked like a LOT of work, if I could figure it out. Then I came across js_escape(). That could take care of my unknown uses of “‘” in random story text – and I’m left with having to strip crlfs (somehow). Well, I can’t get js_escape to do anything. I started with examples on the net — makes no diff.
A piece, for example, is Posted in <?php the_category(‘, ‘) ?> and I have a category with “‘” in the title – so this seems like an easy confirmation — but it doesn’t work for me. I changed it to: Posted in <?php js_escape(the_category(‘, ‘)) ?>
So, not wanting to get a PHD in wordpress-ology, I thought I’d see if someone can tell me what I’m doing wrong (or better, how to fix this and strip the crlf’s in the_excerpt, too).
Here is an example of what I need in one line for the scroller: pausecontent2[0]=’News.com: Technology and business reports‘
Here is the code which does a fine job displaying what I want, but not as one line with escaped “‘”.
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><h5><?php the_title(); ?></h5></h2>
<div class=”entry-content-alt”>
<?php the_excerpt(); ?></div>
<p class=”postmetadata”>Posted in <?php the_category(‘, ‘) ?> by <?php the_author() ?> : <?php the_time(‘F j, Y – g:ia’) ?></p>
</div><?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<p>Sorry, but you are looking for something that isn’t here.</p><?php endif; ?>
— Any help would be appreciated! It seems that I need to spend weeks learning wordpress, php, javascript to make this simple change work for me — I’d really like to avoid that…uh…help?
Thanks a bunch!! — Joe B.
- The topic ‘js_escape – why nothing?’ is closed to new replies.