post template
-
Hello, does anyone know how i make a custom post template,and get rid of all comments,meta,author,date etc?
-
Create a child theme, then copy single.php from the parent to your child and edit it appropriately.
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
Oh, then just edit single.php and content.php appropriately. The plugin “show current template” is a godsend when working on themes.
-
This reply was modified 9 years, 1 month ago by
Steven Stern (sterndata).
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">→</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-## -->The post gallery?
yes
No. I meant “What do you mean by ‘the post gallery'”?
i have put some media in the post, and in the inspect they appear as gallery items
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.
ok thank you.
-
This reply was modified 9 years, 1 month ago by
The topic ‘post template’ is closed to new replies.