Twenty Twelve
Remove title from front page template? (3 posts)

  1. jpuerini
    Posted 3 years ago #

    Hello. I am trying to create a new page template to show no header with full width and sidebar widget area on the bottom. here is my code in the .php file I created from the page.php file, saved into my child theme. What am I doing wrong?

    Template Name: No title front page template
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    			<?php while ( have_posts() ) : the_post(); ?>
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<div class="entry-content">
    			<?php the_content(); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<footer class="entry-meta">
    			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
    		</footer><!-- .entry-meta -->
    	</article><!-- #post -->
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    		</div><!-- #content -->
    	</div><!-- #primary -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use a pastebin. As it stands, your posted code may now have been permanently damaged/corrupted by the forum's parser.]

  2. Michael
    Forum Moderator
    Posted 3 years ago #

    What am I doing wrong?

    no idea without seeing the result of your code - please post a link to the site with the problem.

    one obvious fault is that the template is not calling any sort of header template; this could be a custom header where you remove the unwanted elements, but which has to have the essential DOCTYPE declaration and the <head> section.


  3. beakerflo
    Posted 3 years ago #

    All my files are still original. I made a child theme. Took the content-page.php file.
    And removed the part:

    <h1 class="entry-title"><?php the_title(); ?></h1>

    This effectively removed my header in pages.
    Another option is to use this in you style.css:

    .entry-header {
        visibility: none;

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.