the_excerpt();

  • Unknown's avatar

    hi ;
    when i use the_excerpt();
    i will disappear sidebar ,
    Why??!!

  • Unknown's avatar

    Why are you inserting that code?

    Where, exactly are you inserting it?

  • the_excerpt(); cannot be used on WordPress.com as PHP functions are not supported here. You can learn more in our code guide what types of code you can use on WordPress.com.

    You may use the More tag in your post editor to display an excerpt:

    http://en.support.wordpress.com/splitting-content/more-tag/

  • Unknown's avatar

    index.php

    <?php
    /**
     * The main template file.
     *
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * E.g., it puts together the home page when no home.php file exists.
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package pir-Javid
     */
    
    get_header(); ?>
    
    	<section class="feature-image feature-image-default-alt" data-type="background" data-speed="2">
    		<h1 class="page-title">Blog</h1>
    	</section>
    
    <!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=BLOG CONTENT=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-->
    	<div class="container">
    		<div id="primary" class="row">
    			<main id="content" class="col-sm-8" role="main">
    				<?php if ( have_posts() ) : ?>
    
    					<?php if ( is_home() && ! is_front_page() ) : ?>
    						<header>
    							<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
    						</header>
    					<?php endif; ?>
    
    					<?php /* Start the Loop */ ?>
    					<?php while ( have_posts() ) : the_post(); ?>
    
    						<?php
    
    						/*
                             * Include the Post-Format-specific template for the content.
                             * If you want to override this in a child theme, then include a file
                             * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                             */
    						get_template_part( 'template-parts/content', get_post_format() );
    						?>
    
    					<?php endwhile; ?>
    
    					<?php the_posts_navigation(); ?>
    
    				<?php else : ?>
    
    <!--					--><?php //get_template_part( 'template-parts/content', 'none' ); ?>
    
    <!--					--><?php //get_template_part( 'content', get_post_format() ); ?>
    
    				<?php endif; ?>
    			</main>	<!-- content -->
    			<!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=SIDEBAR=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-->
    			<aside class="col-sm-4 widgetleft">
    				<?php get_sidebar(); ?>
    			</aside><!-- col -->
    			</div><!-- primary -->
    		</div><!-- container -->
    
    <?php get_footer(); ?>

    content.php

    <?php
    ///**
    // * Template part for displaying posts.
    // *
    // * @package pir-Javid
    // */
    //
    //?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<?php the_title( sprintf( '<h3 class="entry-title"><a href="" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); ?>
    
    		<?php if ( 'post' == get_post_type() ) : ?>
    			<div class="post-details">
    				<i class="fa fa-user"></i> <?php the_author(); ?>
    				<i class="fa fa-clock-o"></i> <time><?php the_date(); ?></time>
    				<i class="fa fa-folder-open"></i> <?php the_category(', '); ?>
    				<i class="fa fa-tags"></i><?php the_tags('', ', ', ''); ?>
    				<?php pir_javid_posted_on(); ?>
    				<div class="post-comments-badge">
    					<a href=""><i class="fa fa-comments"></i><?php comments_number(0,1,'%');?></a>
    				</div><!-- post-comments-badge -->
    				<div><?php edit_post_link( ' edit','<div><i class="fa fa-pencil"></i>','</div>' ); ?></div>
    			</div><!-- post-details -->
    		<?php endif; ?>
    	</header><!-- .entry-header -->
    	<div class="post-image">
    		<?php if ( has_post_thumbnail() ) { ?>
    		<?php the_post_thumbnail();?>
    		<?php  } ?>
    	</div> <!-- Post-Image -->
    
    	<div class="post-excert">
    		<?php
    
    			the_excerpt();
    		?>
    
    	</div><!-- post-excpert -->
    </article><!-- #post-## -->
  • Our messages crossed – please see the above. You cannot add or change PHP files here on WordPress.com.

    If you need help with a site you’re running on your own hosting, you can get help over at WordPress.org:

    http://wordpress.org/support/

    You’ll need a free WordPress.org account to post – if you don’t already have one, you can register here:

    https://wordpress.org/support/register.php

  • Unknown's avatar
  • No need to apologize. :)

  • The topic ‘the_excerpt();’ is closed to new replies.