The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Custom Community
How do I show excerpt instead of whole article (Theme: Custom Community) (2 posts)

  1. lourizareyes
    Posted 3 years ago #

    I tried changing the the_content to the_excerpt.. but still no change.... that code isn't in the index.php ....

    here is what's in the index.php.. i hope anyone here can help me show the excerpt of the blog in the home page instead of the whole article....

    global $cap;
    global $wp_query;
    <div id="content" class="span8">
        <div class="padder">
            <div class="clear"></div>
            <?php do_action('bp_before_blog_home'); ?>
            if ($cap->posts_lists_style_home == 'magazine') {
                $args = array();
                $args['amount'] = get_option('posts_per_page', 9);
                $args['img_position'] = cc_get_magazine_style($cap->magazine_style_home);
                echo cc_list_posts($args);
                <div class="navigation">
                    <div class="alignleft"><?php next_posts_link(__('← Previous Entries', 'cc')) ?></div>
                    <div class="alignright"><?php previous_posts_link(__('Next Entries →', 'cc')) ?></div>
                <?php } else { ?>
                <div class="clear"></div>
                <div class="page" id="blog-latest">
                    <?php if (have_posts()) : ?>
                        <?php while (have_posts()) : the_post(); ?>
                            <?php do_action('bp_before_blog_post') ?>
                            <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                                <div class="author-box visible-desktop">
                                    <?php echo get_avatar(get_the_author_meta('user_email'), '50'); ?>
                                    <?php if (defined('BP_VERSION')) { ?>
                                        <p><?php printf(__('by %s', 'cc'), bp_core_get_userlink($post->post_author)) ?></p>
                                    <?php } ?>
                                <div class="post-content span11">
                                    <span class="marker visible-desktop"></span>
                                    <h2 class="posttitle"><a>" rel="bookmark" title="<?php _e('Permanent Link to', 'cc') ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                                    <p class="date"><?php the_time('F j, Y') ?> <em><?php _e('in', 'cc') ?> <?php the_category(', ') ?><?php if (defined('BP_VERSION')) {printf(__(' by %s', 'cc'), bp_core_get_userlink($post->post_author));} ?></em></p>
                                    <div class="entry">
                                        <?php do_action('blog_post_entry') ?>
                                    <?php $tags = get_the_tags();
                                    if ($tags) { ?>
                                        <p class="postmetadata"><span class="tags"><?php the_tags(__('Tags: ', 'cc'), ', ', ''); ?></span> <span class="comments"><?php comments_popup_link(__('No Comments »', 'cc'), __('1 Comment »', 'cc'), __('% Comments »', 'cc')); ?></span></p>
                                    <?php } else { ?>
                                        <p class="postmetadata"><span class="comments"><?php comments_popup_link(__('No Comments »', 'cc'), __('1 Comment »', 'cc'), __('% Comments »', 'cc')); ?></span></p>
                                    <?php } ?>
                                <?php do_action('bp_after_blog_post') ?>
                            <?php endwhile; ?>
                        <?php if(function_exists('wp_pagenavi')):
                        else: ?>
                        <div class="pagination">
                            $big = 999999999; // need an unlikely integer
                            echo paginate_links(array(
                                'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
                                'format' => '?paged=%#%',
                                'current' => max(1, get_query_var('paged')),
                                'total' => $wp_query->max_num_pages
                        <?php endif;?>
                    <?php else : ?>
                        <h2 class="center"><?php _e('Not Found', 'cc') ?></h2>
                        <p class="center"><?php _e('Sorry, but you are looking for something that isn\'t here.', 'cc') ?></p>
                        <?php locate_template(array('searchform.php'), true) ?>
                    <?php endif; ?>
                    <?php } ?>
            <?php do_action('bp_after_blog_home') ?>
        </div><!-- .padder -->
    </div><!-- #content -->
    <?php get_footer() ?>

    [Please post code or markup between backticks or use the code button. Or better still - use a pastebin. Your posted code has now been permanently damaged/corrupted by the forum's parser.]


  2. konradS
    Posted 3 years ago #

    hi lourizareyes,

    please never change theme files if you want to stay update safe.

    ** all your changes in theme files will be lost with every update of the theme.

    you can change the excerpt/full-text thing in the theme settings of the theme.

    and select "excerpt" instead if "content", then just the excerpt will be shown.

    hope this helps, konrad

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic