• Resolved RJonathan

    (@rjonathan)


    Hello,

    I’ not really into coding, so maybe I’m missing something very stupid here.
    I want to use more-tags for the mainpage of my yoko-child-theme to show customized excerpts. But on the category-pages I want the whole texts to be shown.
    So I tried this code, but it doesn’t work. The category-pages still show customized excerpts. Do you have any idea why?

    <div class="entry-content">
    		<?php if ( is_category() ) : // Override more-tag for category. ?>
    			<?php global $more;    // Declare global $more (before the loop).
    			$more = 0;    // Set to display content above the more tag.
    			the_content( __( 'Continue Reading &rarr;', 'yoko' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'yoko' ), 'after' => '</div>' ) ); ?>					
    
     		<?php elseif ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    			<?php the_excerpt(); ?>			
    
    		<?php else : ?>
    			<?php the_content( __( 'Continue Reading &rarr;', 'yoko' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'yoko' ), 'after' => '</div>' ) ); ?>
    		<?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Override More-Tag doesn't work’ is closed to new replies.