WordPress.org

Ready to get started?Download WordPress

Forums

the_content_limit (9 posts)

  1. horizon70s
    Member
    Posted 1 year ago #

    This is kind of a 101 question on the_content_limit - but I have an inconsistency that I'm frustrated with and need a second opinion.

    I have the following site below that uses the_content_limit to post up the latest 280 of a post, and it's set to show the latest 2 posts.

    http://www.warningfallingwaterfowl.com/

    What's odd is when you click on a post, the sidebar shows the latest 2 posts in it's entirety, ignoring the 280 limit. I can't figure out why it respects the limit on the homepage, but not in the posts.

    Here is the code I'm using:

    <?php $recent = new WP_Query("showposts=2"); while($recent->have_posts()) : $recent->the_post();?>
    <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    <img style="float:left; border: 1px solid #000000; margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" />
    <?php else: ?>
    
    <?php endif; ?>
    <b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
    <?php the_content_limit(280, ""); ?>
    
    <div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
    
    <?php endwhile; ?>

    Anyone have any ideas? Many thanks in advance.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Why show the recent posts, if you're displaying 280?
    The most recent will automatically display on the top anyway.

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the_content_limit() is not a generic WordPress function; it is either from your theme or from a plugin.

    to get an answer to your question, please post the full code of that function.

    possibly influenced by the global $more variable - similar to the_content() http://codex.wordpress.org/Customizing_the_Read_More#When_to_set_.24more

    also, as you are using a commercial theme, it might be the best to contact the theme's seller for support.

  4. Hi!

    He did post over at our forums, and since he gets the exact same results with the same code on the default WP theme, I sent him over here. ;)

  5. horizon70s
    Member
    Posted 1 year ago #

    Anyone?

  6. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    gets the exact same results with the same code on the default WP theme

    in which case, 'the_content_limit()' is likely to be from a plugin (?)

    have you searched the plugins for that function?

    what happens if you deactivate all plugins?

    have you tried to play with the value of the $more variable?

    what if you replace the_content_limit() with the_excerpt() ?

  7. bellasys
    Member
    Posted 1 year ago #

    I have customized themes using the plugin "limit post add on" http://wordpress.org/extend/plugins/limit-post-add-on/

    I don't have time this very second to answer the direct question, which seems to really be not "why" such a thing happens, but "how" to deal with this in a post, and to solve the problem. If desired, I can follow up with a sample from another of my blogs which customizes the use of this plugin. I first encountered it in "Brave Zeenat" by Dizenoco, a template that is pretty luscious for photo/video...

    hit me up if needed...

  8. Marventus
    Member
    Posted 1 year ago #

    Hi there.
    You could always use the_excerpt() instead and customize the contents either on a per post basis or dynamically.
    Cheers!

  9. bellasys
    Member
    Posted 1 year ago #

    Let me clarify-

    the_content_limit() comes from the Plugin "Limit Post Add On" at the URL I provided above.

Topic Closed

This topic has been closed to new replies.

About this Topic