0

I am pretty new in WordPress theme development and I have the following problem showing posts.

You can easily understand what I mean opening this link: http://lnx.asper-eritrea.com/25-ottobre-2013-roma-manifestazione-per-le-vittime-di-lampedusa-piazza-montecitorio-ore-10/

As you can see this is a post but this is not shown the entire post content but only approximately 3 rows of the entire post content (thene is printed the [...] that I think means that there are other text).

So into my single.php file (the one that show a single post content) I found:

    <header class="header-sezione">

        <?php
            // Start the Loop.
            while ( have_posts() ) : the_post();

                /*
                 * Include the post format-specific template for the content. If you want to
                 * use this in a child theme, then include a file called called content-___.php
                 * (where ___ is the post format) and that will be used instead.
                 */
                get_template_part( 'content', get_post_format() );

                // Previous/next post navigation.
                //twentyfourteen_post_nav();

                // If comments are open or we have at least one comment, load up the comment template.
                if ( comments_open() || get_comments_number() ) {
                    comments_template();
                }
            endwhile;
        ?>
    </header>

and this is the code of the content.php file (the one that show the post content):

<?php
/**
 * The default template for displaying content
 *
 * Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage AsperTheme
 * @since AsperTheme 1.0
 */
?>


<!-- Create a div with a unique ID thanks to the_ID() and semantic classes with post_class() 
     the_ID(): Print the numeric ID of the current post 
     post_class(): Print out and add various post-related classes to the div tag
-->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                              

    <header>
        <h2 class="entry-title">
                <a href="<?php the_permalink(); ?>" 
                   title="<?php printf(__('Permalink to %s', 'your-theme'), the_title_attribute('echo=0')); ?>"
                   rel="bookmark"><?php the_title(); ?>
                </a>

        </h2>

        <div class="entry-meta">
            <span class="meta-prep meta-prep-author"><?php _e('By ', 'your-theme'); ?></span>
            <span class="author vcard">
                <a class="url fn n" href="<?php echo get_author_link(false, $authordata -> ID, $authordata -> user_nicename); ?>" 
                                    title="<?php printf(__('View all posts by %s', 'your-theme'), $authordata -> display_name); ?>"><?php the_author(); ?>
                </a>
            </span>
            <span class="meta-sep"> | </span>
            <span class="meta-prep meta-prep-entry-date"><?php _e('Published ', 'your-theme'); ?></span>
            <span class="entry-date">
                <abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time(get_option('date_format')); ?></abbr>
            </span>
            <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
         </div>     <!-- .entry-meta -->

    </header>

    <div class="entry-content">    
        <!--<?php the_content(__('Continue reading <span class="meta-nav">&raquo;</span>', 'your-theme')); ?>-->
        <?php the_excerpt(); ?>
        <?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'your-theme' ) . '&after=</div>') ?>
    </div>      <!-- .entry-content -->

    <div class="entry-utility">
        <span class="cat-links">
            <span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e('Posted in ', 'your-theme'); ?></span>
            <?php echo get_the_category_list(', '); ?>
        </span>
        <span class="meta-sep"> | </span>
        <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'your-theme' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ) ?>
            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'your-theme' ), __( '1 Comment', 'your-theme' ), __( '% Comments', 'your-theme' ) ) ?></span>
            <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
    </div>      <!-- #entry-utility --> 

</article>  <!-- #post-<?php the_ID(); ?> -->

So I think that when I open a post I see only its beginning part could depend by the fact that into content.php I have:

<?php the_excerpt(); ?>

Is it right? How can I show the entire post and not only its beginning part?

2

in content.php change <?php the_excerpt(); ?> with

<?php the_content(); ?>

Or use this content.php file instead. I made changes in your content.php

<?php
/**
 * The default template for displaying content
 *
 * Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage AsperTheme
 * @since AsperTheme 1.0
 */
?>


<!-- Create a div with a unique ID thanks to the_ID() and semantic classes with post_class() 
     the_ID(): Print the numeric ID of the current post 
     post_class(): Print out and add various post-related classes to the div tag
-->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                              

    <header>
        <h2 class="entry-title">
                <a href="<?php the_permalink(); ?>" 
                   title="<?php printf(__('Permalink to %s', 'your-theme'), the_title_attribute('echo=0')); ?>"
                   rel="bookmark"><?php the_title(); ?>
                </a>

        </h2>

        <div class="entry-meta">
            <span class="meta-prep meta-prep-author"><?php _e('By ', 'your-theme'); ?></span>
            <span class="author vcard">
                <a class="url fn n" href="<?php echo get_author_link(false, $authordata -> ID, $authordata -> user_nicename); ?>" 
                                    title="<?php printf(__('View all posts by %s', 'your-theme'), $authordata -> display_name); ?>"><?php the_author(); ?>
                </a>
            </span>
            <span class="meta-sep"> | </span>
            <span class="meta-prep meta-prep-entry-date"><?php _e('Published ', 'your-theme'); ?></span>
            <span class="entry-date">
                <abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time(get_option('date_format')); ?></abbr>
            </span>
            <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
         </div>     <!-- .entry-meta -->

    </header>

    <div class="entry-content">    
        <?php the_content(__('Continue reading <span class="meta-nav">&raquo;</span>', 'your-theme')); ?>
        <?php // the_excerpt(); ?>
        <?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'your-theme' ) . '&after=</div>') ?>
    </div>      <!-- .entry-content -->

    <div class="entry-utility">
        <span class="cat-links">
            <span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e('Posted in ', 'your-theme'); ?></span>
            <?php echo get_the_category_list(', '); ?>
        </span>
        <span class="meta-sep"> | </span>
        <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'your-theme' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ) ?>
            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'your-theme' ), __( '1 Comment', 'your-theme' ), __( '% Comments', 'your-theme' ) ) ?></span>
            <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
    </div>      <!-- #entry-utility --> 

</article>  <!-- #post-<?php the_ID(); ?> -->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.