WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. lourizareyes
    Member
    Posted 1 year 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....

    <?php
    global $cap;
    global $wp_query;
    get_header()
    ?>
    
    <div id="content" class="span8">
        <div class="padder">
            <div class="clear"></div>
            <?php do_action('bp_before_blog_home'); ?>
            <?php
            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>
                </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>
    
                                <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') ?>
                                    </div>
    
                                    <?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 } ?>
                                </div>
    
                            </div>
    
                                <?php do_action('bp_after_blog_post') ?>
    
                            <?php endwhile; ?>
                        <?php if(function_exists('wp_pagenavi')):
                            wp_pagenavi();
                        else: ?>
                        <div class="pagination">
                            <?php
                            $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
                            ));
                            ?>
                        </div>
                        <?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; ?>
                        </div>
                    <?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.]

    http://wordpress.org/extend/themes/custom-community/

  2. konradS
    Member
    Posted 1 year 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.

    just go to APPEARANCE -> THEME SETTINGS -> GENERAL -> EXCERPTS
    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