• Resolved craftersuniversity

    (@craftersuniversity)


    I’m using the latest version of Twenty Eleven and made a child theme i’m really please with. There is only one problem. When i search for posts, the result page looks nothing like the other post listing pages. The YouTube embeds are gone, only the text above the “More” tag is visible, and any links in that text has been removed. Also the “Continue reading” link that should be visible due to the “more” tag is gone. How can i make the search result page more similar to the other post listings?

    CraftersU.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter craftersuniversity

    (@craftersuniversity)

    I just tried a couple of different themes:

    BuddyPress theme and Twenty Thirteen does not have this problem.
    Twenty Eleven, Twenty Twelve, Twenty Fourteen and Responsive all have this problem.

    At first i thought it was a CSS code thing, that the embeds, links and more tags where simply hidden, but when i carefully read the page source code, the necessary text and tags simply isn’t there, so this must be a PHP code thing… But how do i change it?

    Do not edit the theme itself. First create a child theme for your changes.

    Thread Starter craftersuniversity

    (@craftersuniversity)

    I have already made a child theme and made extensive changes to it. However, it isn’t the cause of this trouble, since the other themes i listed above shows the same problem. It is clear however that this is a theme related issue, so my best guess is that i need to make some alteration in my child theme in order to produce the result i want. Does anyone out there know how to accomplish this?

    Thread Starter craftersuniversity

    (@craftersuniversity)

    Does anyone know how to fix this problem?

    Michael

    (@alchymyth)

    forum search might have given you the solution (?) but here is it again:

    the search results show the excerpt instead of the content (https://codex.www.ads-software.com/Function_Reference/the_excerpt ), done in content.php;

    edit this content.php in your child theme, find this section:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    		<div class="entry-summary">
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>

    change it to:

    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->

    this should now show the full content (up to the ‘more tag’ if used) in all index and archive pages of your site.

    Thread Starter craftersuniversity

    (@craftersuniversity)

    Thanx, that did it!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘No embeds in search result’ is closed to new replies.