WordPress.org

Ready to get started?Download WordPress

Forums

the_content_limit in the sidebar (8 posts)

  1. Pete
    Member
    Posted 5 years ago #

    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; ?>'

  2. askie
    Member
    Posted 5 years ago #

    what's the plugin?

  3. ashafaaiz
    Member
    Posted 5 years ago #

    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.

  4. tomasi514
    Member
    Posted 5 years ago #

    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 ;-)

  5. MichaelH
    Member
    Posted 5 years ago #

    tomasi514 please see your other thread you started for a solution to the problem.

  6. webstergroup
    Member
    Posted 5 years ago #

    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.com

    on this page you can see the text over flows
    http://pa-legion.webstergrouponline.com/?p=29

    Anyone know why this tag breaks on the single post page?

  7. joemiller
    Member
    Posted 5 years ago #

    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?

  8. Voislav Avramovski (Voya)
    Member
    Posted 5 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Topic