• Resolved [email protected]

    (@jamesskykingcreativecom)


    I am barely keeping my head above water in CSS and PHP is pretty much a mystery for the most part. I get it a little. Anyway, here on my site;

    <a href="https://mypestcontrolinfo.com/eliminate-centipedes/">https://mypestcontrolinfo.com/eliminate-centipedes/</a>
    
    https://mypestcontrolinfo.com

    What is happening here is that I am seeing my entry.title (post title) showing up twice. This is only on the individual post pages and not on the main post page which contains all my posts:

    The top one (brown text)

    <h2 class="title entry-title">

    Is the one that I want to turn off. I think is specified in the parent theme, twenty twelve and I don’t know how to turn it off.

    I think It is conflicting with the h1 class that I have specified in my child theme.

    <h1 class="entry-title"

    Thanks in advance.

    Jim

Viewing 4 replies - 1 through 4 (of 4 total)
  • what are the full codes of single.php and of content.php of your child theme?

    Thread Starter [email protected]

    (@jamesskykingcreativecom)

    Thank for the quick reply.

    Here is what I have for the single.php:

    <?php
    /**
     * The Template for displaying all single posts
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    	<div class="entry">
    	<div <?php post_class('single clear'); ?> id="post_<?php the_ID(); ?>">
        	<div class="post-meta">
            	<h2 class="title entry-title"><?php the_title(); ?></h2>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', get_post_format() ); ?>
    
    				<nav class="nav-single">
    					<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
    					<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentytwelve' ) . '</span> %title' ); ?></span>
    					<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></span>
    				</nav><!-- .nav-single -->
    
    				<?php comments_template( '', true ); ?>
    
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I actually do not have a content.php file for my child theme. This is the code for the content.php from the parent theme which was last updated on 12/19/13 which was probably the last update to the theme …. maybe?

    <?php
    /**
     * The default template for displaying content
     *
     * Used for both single and index/archive/search.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    ?>
    
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
    		<div class="featured-post">
    			<?php _e( 'Featured post', 'twentytwelve' ); ?>
    		</div>
    		<?php endif; ?>
    		<header class="entry-header">
    			<?php the_post_thumbnail(); ?>
    			<?php if ( is_single() ) : ?>
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    			<?php else : ?>
    			<h1 class="entry-title">
    				<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
    			</h1>
    			<?php endif; // is_single() ?>
    			<?php if ( comments_open() ) : ?>
    				<div class="comments-link">
    					<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
    				</div><!-- .comments-link -->
    			<?php endif; // comments_open() ?>
    		</header><!-- .entry-header -->
    
    		<?php if ( is_search() ) : // Only display Excerpts for Search ?>
    		<div class="entry-summary">
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>
    
    		<footer class="entry-meta">
    			<?php twentytwelve_entry_meta(); ?>
    			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
    			<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
    				<div class="author-info">
    					<div class="author-avatar">
    						<?php
    						/** This filter is documented in author.php */
    						$author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 68 );
    						echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
    						?>
    					</div><!-- .author-avatar -->
    					<div class="author-description">
    						<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
    						<p><?php the_author_meta( 'description' ); ?></p>
    						<div class="author-link">
    							<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    								<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
    							</a>
    						</div><!-- .author-link	-->
    					</div><!-- .author-description -->
    				</div><!-- .author-info -->
    			<?php endif; ?>
    		</footer><!-- .entry-meta -->
    	</article><!-- #post -->

    Thank you again.

    Jim

    you seem ta have added the post div and post title to the single.php, while it is by default already in content.php – just decide which you want to delete…

    if the content.php needs to be as it is to be used for archives etc, you might need to use a conditional statement based on ‘is_single()’ to hide/remove the title part from content.php

    Thread Starter [email protected]

    (@jamesskykingcreativecom)

    I just commented it out to test it and…Amazing! That not only fixed that problem with the double header. It also seemed to have solved the issue of my sidebar dropping below my post. I don’t know how exactly. But it seems to be working properly again.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Entry Title Showing up Twice’ is closed to new replies.