• Hello, does anyone know how i make a custom post template,and get rid of all comments,meta,author,date etc?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Create a child theme, then copy single.php from the parent to your child and edit it appropriately.

    https://codex.ww.wp.xz.cn/Child_Themes

    Thread Starter phaidonas

    (@phaidonas)

    i have created a custom theme from with underscore.I dont want the page that dispays the posts but inside the post itself.Thanks, and sorry for the noob question

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Oh, then just edit single.php and content.php appropriately. The plugin “show current template” is a godsend when working on themes.

    Thread Starter phaidonas

    (@phaidonas)

    ok thank you very much,Do you know also where i manage the post gallery? the code now at content.php is like:

    <?php
    /**
     * Template part for displaying posts
     *
     * @link https://codex.ww.wp.xz.cn/Template_Hierarchy
     *
     * @package South_Arch
     */
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<?php
    		if ( is_single() ) :
    			the_title( '<h1 class="entry-title">', '</h1>' );
    		else :
    			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    		endif;
    
    		if ( 'post' === get_post_type() ) : ?>
    		<div class="entry-meta">
    
    		</div><!-- .entry-meta -->
    		<?php
    		endif; ?>
    	</header><!-- .entry-header -->
    
    	<div class="entry-content">
    		<?php
    			the_content( sprintf(
    				/* translators: %s: Name of current post. */
    				wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'south-arch' ), array( 'span' => array( 'class' => array() ) ) ),
    				the_title( '<span class="screen-reader-text">"', '"</span>', false )
    			) );
    
    			wp_link_pages( array(
    				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'south-arch' ),
    				'after'  => '</div>',
    			) );
    		?>
    	</div><!-- .entry-content -->
    
    	
    </article><!-- #post-## -->
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    The post gallery?

    Thread Starter phaidonas

    (@phaidonas)

    yes

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    No. I meant “What do you mean by ‘the post gallery'”?

    Thread Starter phaidonas

    (@phaidonas)

    i have put some media in the post, and in the inspect they appear as gallery items

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Search the codex for “gallery”. If you’re going to use underscores, you’re going to get VERY familiar with the codex and developer.ww.wp.xz.cn.

    Thread Starter phaidonas

    (@phaidonas)

    ok thank you.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘post template’ is closed to new replies.