• Resolved mcnaden

    (@mcnaden)


    Hello,

    I am a novice user.

    Our site has a home page that is setup to show the three most recent posts of a specific category with the excerpt instead of the content.

    https://bearleaderchronicle.com/site/

    Now I would like to have another page on our site that looks exactly the same, but which displays three posts of a different category.

    So I duplicated the home page and changed the category which is displayed. This works fine, except that instead of the excerpt, all the posts show the content.

    https://bearleaderchronicle.com/site/lodgings/

    How is the home page set to display excerpts instead of the content so I can change the new page accordingly?

    Thanks for the assistance.
    Mark

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mcnaden

    (@mcnaden)

    Ahh, Thanks! that seems to be the solution.

    Having virtually no coding abilities, I assume it would go in the content.php file associated with the page template.

    This is the current content file that calls the posts into the page. Where should the new code go?

    Thanks!

    <?php
    /**
     * The default template for displaying content
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <header class="entry-header">
    
            <?php
            if (function_exists('get_smooth_slider')) {
                $slider_id = get_slider_for_the_post(get_the_ID());
                if ($slider_id) {
                    ?>
                    <div id="entry-slider-<?php the_ID(); ?>" class="entry-slider">
                        <?php
                        global $smooth_slider;
                        $smooth_slider['goto_slide'] = '1';
                        get_smooth_slider($slider_id);
                        ?>
                    </div>
                    <?php
                }
            }
            ?>
    
            <h1 class="entry-title<?php echo (is_sticky()) ? ' entry-title-sticky' : ''; ?>">
                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr(sprintf(__('Permalink to %s', 'twentyeleven'), the_title_attribute('echo=0'))); ?>" rel="bookmark">
                    <?php $position = blc_get_extra_title_position(); ?>
                    <?php if ($position !== 'above') { ?>
                    <?php the_title(); ?>
                    <?php echo blc_get_extra_title(); ?>
                <?php } else { ?>
                    <?php echo blc_get_extra_title(); ?>
                    <?php the_title(); ?>
                <?php } ?>
                </a>
            </h1>
    
        </header><!-- .entry-header -->
        <div class="clear"></div>
        <aside class="entry-sidebar">
    
            <?php if ('post' == get_post_type()) : ?>
                <div class="entry-meta">
                    <?php
                    printf(__('<time class="entry-date" datetime="%1$s">%2$s</time>', 'twentyeleven'), esc_attr(get_the_date('c')), esc_html(get_the_date())
                    );
                    ?>
                </div><!-- .entry-meta -->
            <?php endif; ?>
    
            <?php if (is_object_in_taxonomy(get_post_type(), 'location')) : // Hide category text when not supported  ?>
                <?php
                $terms_list = get_the_location_list(get_the_ID(), 'location', '', ', ', '');
                if ($terms_list):
                    ?>
                    <span class="cat-links">
                        <?php
                        echo $terms_list;
                        ?>
                    </span>
                <?php endif; ?>
            <?php endif; ?>
            <?php if ('post' == get_post_type()) : ?>
                <div class="entry-meta">
                    <?php
                    printf(__('<span class="by-author"> <span class="sep"> by </span> <span class="author vcard">%3$s</span></span>', 'twentyeleven'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'twentyeleven'), get_the_author())), get_the_author()
                    );
                    ?>
                </div><!-- .entry-meta -->
            <?php endif; ?>
            <?php
            global $wpsociallikes;
            if (is_a($wpsociallikes, "wpsociallikes"))
                echo $wpsociallikes->add_social_likes();
            ?>
        </aside>
    
        <?php if (is_search()) : // Only display Excerpts for Search     ?>
            <div class="entry-content">
                <?php the_excerpt(); ?>
            </div><!-- .entry-summary -->
        <?php elseif (is_front_page()) : ?>
            <div class="entry-content">
                <?php the_excerpt(); ?>
            </div><!-- .entry-summary -->
        <?php else : ?>
            <div class="entry-content">
                <?php the_content(__('Read more', 'twentyeleven')); ?>
                <?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'twentyeleven') . '</span>', 'after' => '</div>')); ?>
            </div><!-- .entry-content -->
        <?php endif; ?>
    
        <div class="clear"></div>
    
        <footer class="entry-meta">
            <?php edit_post_link(__('Edit', 'twentyeleven'), '<span class="edit-link">', '</span>'); ?>
            <div class="clear"></div>
        </footer><!-- .entry-meta -->
        <div class="clear"></div>
    </article><!-- #post-<?php the_ID(); ?> -->
    Thread Starter mcnaden

    (@mcnaden)

    Ok, got it. My coding was a bit different. Had to change the

    <?php elseif (is_front_page()) : ?>

    to

    <?php elseif (is_page( 'lodgings' )) : ?>

    But you put me on the right track. Many thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show just excerpt instead of content’ is closed to new replies.