WordPress.org

Forums

Twenty Eleven
[resolved] No embeds in search result (7 posts)

  1. craftersuniversity
    Member
    Posted 1 year ago #

    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

  2. craftersuniversity
    Member
    Posted 1 year ago #

    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?

  3. esmi
    Forum Moderator
    Posted 1 year ago #

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

  4. craftersuniversity
    Member
    Posted 1 year ago #

    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?

  5. craftersuniversity
    Member
    Posted 1 year ago #

    Does anyone know how to fix this problem?

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

    the search results show the excerpt instead of the content (http://codex.wordpress.org/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.

  7. craftersuniversity
    Member
    Posted 1 year ago #

    Thanx, that did it!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.