• Resolved Bentrem

    (@bentrem)


    NB: now running Twenty Twelve 0.9 … same output

    I’m doing an experiment: posting lists of links, like a heap of bookmarks.

    I just noticed that Search results munge the list format. see https://www.protension.com/heap/?s=news&submit=Search

    Shouldn’t default behavior be to preserve the format?
    Should that be changed moving forward?

    –@bentrem

    p.s. where is that behavior coded? I’d love to change it locally
    p.s.2 IIRC I’ve seen “excerpt” do this on other themes also

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Bentrem

    (@bentrem)

    Addend: reverted to Twenty Eleven; Twenty Twelve doesn’t indent on <UL>.

    it is not recommended to edit the default theme Twenty Eleven directly – please create a child theme https://codex.www.ads-software.com/Child_Themes

    the search outputs post excerpts which are stripping any html code:

    https://codex.www.ads-software.com/Function_Reference/the_excerpt

    the code for it is in content.php:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    		<div class="entry-summary">
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>

    if an <ul> is indented or not, depends on the stylesheet of the theme, i.e. is a decision of the theme designer;

    change it in style.css if you want.

    Thread Starter Bentrem

    (@bentrem)

    Quite right; is just what I meant by “locally”.
    And yes, theme specific. Was surprised to see such a change in basics.

    Thanks for the pointer … spot on.

    p.s. do you happen to know a theme that would preserve list format in excerpt? (I really do think that should be default behavior. I see “Also in the latter case, HTML tags and graphics are stripped from the excerpt’s content.” so this is evidently a design decision.)

    Addendum: this article in support hits a lot of major points: “How to modify the_excerpt“. see also Advanced Excerpt plugin.

    the moment any theme uses the_excerpt() to generate the shortened version of a post, the html tags will be stripped.

    you can write a custom handwritten excerpt with formatting which would get used by the_excerpt() – below the post editor; if this field does not show, click the ‘screen options’ tab near the top right and tick ‘excerpt’.

    afaik, there is no perfect working solution to preserve the formatting in excerpts;
    a plugin might offer some ways to preserve some of the formatting; for example https://www.ads-software.com/extend/plugins/advanced-excerpt/

    Thread Starter Bentrem

    (@bentrem)

    I’m sure folk had a reason to go with that as default. It’s always bugged me, but hasn’t really had a harsh impact til now, with this “every post is a list” situation.
    cheers

    p.s. “Advanced Excerpt” did what I wanted straight out of the box; no downside seen yet. ??
    Plugin homepage at Bas van Doren’s basvd.com.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Theme: Twenty Eleven] Search excerpt breaks lists’ is closed to new replies.