I need some help tweaking a little PHP for the XTremeCarousel plugin for the Classipress theme for WordPress. This code below truncates the title if it's greater or equal to 14 characters. I need it to do the same thing for the category and the user name so it won't wrap them to another like. If either of them get wrapped, it pushes the 'view more' buttons down below the div they are enclosed in. I can post a link to see the issue if you need it. Here's the part of the code in question, you can see the 2nd line is where the title is grabbed and truncated. I'm going to attempt to rewrite it myself but am open to suggestions as i don't think I have the necessary skills needed to do it ... lol
In the end, each line except the price would need to be truncated to 14 characters so they don't wrap the information down.
<div style="margin-top:16px"></div>
<a id="rb_title"><?php if ( mb_strlen(get_the_title()) >= 14 ) echo mb_substr( get_the_title(), 0, 14 ).'...'; else the_title(); ?></a>
<p id="rb_xtrmcarousel">
Under: <?php if ( get_the_category() ) the_category(', '); else echo get_the_term_list( $post->ID, APP_TAX_CAT, '', ', ', '' ); ?><br />
By: <span class="owner"><?php the_author_posts_link(); ?></span><br />
<span class="rb_price">Price: <?php if ( get_post_meta( $post->ID, 'price', true ) ) cp_get_price_legacy($post->ID); else cp_get_price( $post->ID, 'cp_price' ); ?></span>
</p>
I think this will work for the author's name although it doesn't grab the_author_posts_link.
By: <span class="owner"><?php if ( mb_strlen(get_the_author_nickname()) >= 14 ) echo mb_substr( get_the_author_nickname(), 0, 14 ).'...'; ?><?php if ( mb_strlen(get_the_author_nickname()) <= 14 ) echo mb_substr( get_the_author_nickname(), 0, 14 ).''; ?></span><br />
Every time I try to rewrite the category line, it ends up blank since I don't know what I'm doing... :) however, I can get this to return the category name and it's linked but it's not truncated obviously:
Under: <?php echo get_the_term_list( $post->ID, APP_TAX_CAT, '', ', ', '' ); ?>
Any thoughts?