WordPress.org

Support

Support » Themes and Templates » Hueman » [Resolved] Different excerpt featured

[Resolved] Different excerpt featured

  • I’ve seen the code and excerpt() is used in both cases. But I get the excerpt with … only for featured posts. All other in the list break at paragraph endings and that’s not what I want.
    What am I overlooking?

Viewing 15 replies - 1 through 15 (of 16 total)
  • I looked again and content.php as well as content-featured.php use the_excerpt(). Why the difference?

    An example. It’s about the difference between

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum condimentum hendrerit. Suspendisse et leo tellus…

    and (part as long as the first break)

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum condimentum hendrerit. Suspendisse et leo tellus. Donec ultricies mauris a lacinia rutrum. Suspendisse feugiat quam tellus, et fringilla purus ultricies ut.

    Since I took part in thread with similar problem http://wordpress.org/support/topic/excerpt-not-working-9?replies=1#post-5810450 can you please be more specific:
    -post a link to your website and state exactly what are you trying to achieve.
    Regards,
    Mike

    Hi Pieter,
    I’ve noticed link to your website http://www.pieterraaijmakers.nl/
    in another thread, but let’s continue here.
    At first looked like simple thing, but…no!
    Besides 2 PhP files you mentioned, there’s third controlling “featured” – \hueman\inc\featured.php but solves nothing.
    Line 19

    <?php get_template_part('content-featured'); ?>

    that’s your case – no slider, only 1 featured post – leads again to content-featured.php with classic the_excerpt() function.
    At http://codex.wordpress.org/Excerpt – how to change core the_excerpt() WP function from “…” to whatever you like.
    But, what we both 🙂 don’t understand (at the moment) – is your basic question – why same function behaves different
    – in featured category behaves as defined in core WP
    – rest – as you described.
    Honestly – never noticed this before, it must be some “small Alex’s trick”, that we are “overlooking” (now there’s 2 of us 🙂
    Since I like exploring – I’ll find it, just need some time.
    Re-defining WP core functions is not a solution, there must be something more simple.
    So, let’s leave this open – I’ll try to solve it, and maybe some folks around on forum will be quicker 🙂
    Regards,
    Mike

    Thank Mike.

    I posted my url by mistake on the wrong thread.
    Glad you too think it’s strange.
    Must be something… 😉

    Don’t worry,
    I’ll try to solve it (and maybe somebody else “joins to the club”) – just too busy at the moment for longer examination, thought it’s a “quick hack”, but indeed – a bit “strange”:)
    Mike

    Moderator stephencottontail

    @stephencottontail

    Hueman has an option (Appearance > Theme Options > Blog) to control the excerpt length. What is that option set to? Also, in my testing, if you have set a manual excerpt to your post or if you’re using the <!--more--> quicktag, Hueman will display either the manual excerpt or the content of the post up to the quicktag, regardless of the aforementioned excerpt length setting.

    @stephencottontail,
    many thanks for joining.
    At the moment – involved in too many threads on forum (mea culpa!) + very busty with private part at the moment (but don’t like to leave threads unsolved).
    You are right, eliminating possible issues one by one is slow but in this case best method for solving this thread:
    -Blog excerpt length settings
    -both possible “variables” – (manual excerpts + <!–more–> quicktag ) can add “more fun”.
    So, Pieter – please define this, “help us to help you”

    I found out what it is not 🙂
    If I comment out the if statement in content.php the output is still not the excerpt!

    <?php //if (ot_get_option('excerpt-length') != '0'): ?>
    		<div class="entry excerpt">
    			<?php the_excerpt(); ?>
    		</div><!--/.entry-->
    		<?php //endif; ?>

    Still a mystery. I did:

    1. commented out the admin excerpt() in functions and made a hard coded my own.
    2. added some notes what exactly happens on my site.

    Can’t wait…

    Hi Pieter,
    sorry for the delay, I completely overlooked this thread as unsolved.
    So lets start again: you haven’t replied to questions posted by @stephencottontail:
    1-What are your settings in Appearance > Theme Options >Blog (default is 35 words, if I remember well, I’ve changed it also in my settings)
    2-Have you used manual excerpt or <!–more–> quicktag that can override settings as @stephencottontail described.
    Pls reply, since content.php is controlling post excerpts (and it seems something is conflicting in your case), for example adding 1 line there:

    <?php if (ot_get_option('excerpt-length') != '0'): ?>
    <div class="entry excerpt">
    	<?php the_excerpt(); ?>
    	<a href="<?php the_permalink(); ?>">Read more</a>
    </div><!--/.entry-->
    <?php endif; ?>

    adds a “readmore” link at the end of the post.
    Waiting your reply,
    Mike

    Already have tried all that.

    1. Removed the theme options excerpt which is now:

    function pr_excerpt_length( $length ) {
    		return 30;
    	}
    
    add_filter( 'excerpt_length', 'pr_excerpt_length', 999 );

    2. For sure commented out the logical if in content.php:

    <?php //if (ot_get_option('excerpt-length') != '0'): ?>
    		<div class="entry excerpt"><p class="note">not good. the_excerpt in content:</p>
    			<?php the_excerpt(); ?>
    		</div><!--/.entry-->
    		<?php //endif; ?>

    Now both content.php and content-featured.php should call the_excerpt();

    Adding another the_permalink(); makes no sense I think.

    Moderator stephencottontail

    @stephencottontail

    Forgive me for asking again, because it’s been a bit of time since this thread was in my memory, but what exactly are you trying to solve?

    Do you use a manual excerpt or the <!--more--> quicktag in any of the posts that demonstrate this issue?

    In my testing, I do not see the ellipsis (…) under the following conditions: There is a manual excerpt, or the <!--more--> quicktag appears before the number of words defined as the excerpt length.

    I do see the ellipsis if there is no <!--more--> quicktag, or if the <!--more--> quicktag appears after the number of words defined as the except length.

    My goal is that posts in the columns list group have the same excerpt with ellipsis as the featured post has.

    Moderator stephencottontail

    @stephencottontail

    In my testing, whether a post is a featured post or if it is in a column has no bearing on whether the ellipsis appears. The ellipsis only appears if the <!--more--> tag is not used, or if the <!--more--> tag appears after the number of words defined as the excerpt length. In addition, the ellipsis does not appear if the post has fewer words than the defined excerpt length.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Resolved] Different excerpt featured’ is closed to new replies.
Skip to toolbar