the_content_limit in the sidebar
-
I have this code in my sidebar… the content shows true (first 80 characters) when a category is displayed but when a single post is displayed the sidebar displays all the content (more than 80 characters). This is very weird behaviour, there is no other conditional statements that i can see. Any ideas???
Thanks CG
‘Code:
<?php $recent = new WP_Query(“showposts=3”); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, “thumbnail”, true) ): ?>
” rel=”bookmark”><img style=”float:left;margin:0px 10px 0px 0px;” src=”<?php echo get_post_meta($post->ID, “thumbnail”, true); ?>” alt=”alt text” />
<?php else: ?>
” rel=”bookmark”><img style=”float:left;margin:0px 10px 0px 0px;” src=”<?php bloginfo(‘template_url’); ?>/images/thumbnail.jpg” alt=”Default thumbnail” />
<?php endif; ?>
<b>” rel=”bookmark”><?php the_title(); ?></b>
<?php the_content_limit(80, “read more »”); ?><div style=”border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;”></div>
<?php endwhile; ?>’
-
what’s the plugin?
Hi,
I want to display all my contents within the_content_limit() in the sidebar. But the problem is, only part of my content was displayed in the sidebar. So, whats the remedy for displaying all my content in the sidebar.Hi ashafaaiz, I do not clearly understand your problem mate, do you want to use the_content_limit function in the sidebar but to display all your post content ?
On my side, I have another problem 🙂 : what plugin or trick must I use to define the_content_limit function, I try to use it in my default theme, I tried some plugins, none of them work up to now, I still have this fatal error undefined function problem..perthmetro, sorry man, I cannot help you now, perhaps once I’ll know how to define the_content_limit 😉
tomasi514 please see your other thread you started for a solution to the problem.
I am having the same problem as perthmetro above.
the_content_limit works fine on all pages except for single post pages
you can see single post excepts at the bottom of this page
http://pa-legion.webstergrouponline.comon this page you can see the text over flows
http://pa-legion.webstergrouponline.com/?p=29Anyone know why this tag breaks on the single post page?
Anyone ever resolve this issue? I’m having the same problem. Namely, the_content_limit works everywhere except on single post pages. I’m not using a plugin. The command is built into the theme.
Any thoughts?
Hello,
I was struggling with this too. However, i found the solution for my problem and created a post for it on my blog – check it here: http://mr-wordpress.com/fix-for-the-the_content_limit-function-limit-posts-plugin-when-previewing-a-single-post/
- The topic ‘the_content_limit in the sidebar’ is closed to new replies.