Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11578
    ispcolohost
    Member

    Hello, I was wondering if you could tell me what I’d need to change in a child theme to only display the post titles on categories, archives and searches?

    Thanks!

    #11594
    Sakin
    Keymaster

    @ispcolohost: You have to copy your archive.php and search.php and in those file replace the following code

    <?php while ( have_posts() ) : the_post(); ?>
    
    	<?php
    		/* Include the Post-Format-specific template for the content.
    		 * If you want to overload 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( 'content', get_post_format() );
    	?>
    
    <?php endwhile; ?>

    With the following code

    <?php while ( have_posts() ) : the_post(); ?>
    
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    							
    		<div class="entry-container">
    			<header class="entry-header">
    				<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'catcheverest' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    			</header><!-- .entry-header -->
    		</div><!-- .entry-container --> 
    	 
    	 </article><!-- .post--> 
    	 
    <?php endwhile; ?>
    #58531
    lanretobi
    Participant

    helo Sakin, pls how do i make my post to display only post headline on post page?

    #58536
    Sakin
    Keymaster

    @lanretobi: For this you need to build child theme and then copy content.php in your child theme and edit it as per your need. If you just want to hide with css then you can add the following css in “Appearance => Theme Options => Custom CSS” box:
    .blog .entry-summary { display: none; }

    Note: please post in your site URL so that I can check in your blog page.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘What changes needed to display only post titles?’ is closed to new replies.