WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] I rremoved "entry-titles" but they still get credit (10 posts)

  1. portermonkey
    Member
    Posted 3 years ago #

    I have removed all my entry titles on each page. But when I run a check for the use of tags (<title>, <h1>, <h2> etc) the entry title which i am not displaying gets the h1 tag. I would like to remove this.
    How is the h1 designated? is it by the font size given in the css?
    thanks

  2. How is the h1 designated? is it by the font size given in the css?

    No, heading tags like <h1> and <h2> are in the HTML contained in your theme files - index.php, single.php, loop.php, etc.

    I'm not clear exactly what you're trying to remove where. Can you give a specific URL with a specific example?

    p.s. this is unrelated but I strongly recommend not underlining text in your site that is not clickable. It confuses people since we are used to thinking of underlined text as links.

  3. portermonkey
    Member
    Posted 3 years ago #

    check out my "testimonials" page for example. I removed the .entry-title (by not displaying it) for the page. but when i check the tags on that page the entry title is an h1 tag, so my h1 tag for that page is basically hidden text.

  4. OK, now I understand - thanks for clarifying.

    You need to go into page.php in your theme folder and remove the line that references the_title() - it may look something like this:

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

    If you copy your page.php code into a Pastebin - http://pastebin.com/ - I can more easily tell you what to remove.

  5. portermonkey
    Member
    Posted 3 years ago #

    there is nothing like that in my page.php.

    here is all of it (it is small so i post)

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    
    get_header(); ?>
    
    		<div id="container">
    			<div id="content" role="main">
    
    			<?php
    			/* Run the loop to output the page.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-page.php and that will be used instead.
    			 */
    			get_template_part( 'loop', 'page' );
    			?>
    
    			</div><!-- #content -->
    		</div><!-- #container -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  6. OK, then you should find it in loop.php but it gets more complicated because loop applies to both pages & posts, and I see you also have a blog.

    May I ask why you don't want to display the page title? There might be a better solution.

  7. portermonkey
    Member
    Posted 3 years ago #

    I already am not displaying the page titles. And they are being given an h1 tag. I want to apply h1 tag elsewhere and i do not think it is good to use it more than once on a page. Nor can it be good to use it for hidden text

  8. Actually, my mistake - if you see a file called loop-page.php in your theme it should be there.

  9. cangpo
    Member
    Posted 3 years ago #

    Yes, in loop-page.php

    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php if ( is_front_page() ) { ?>
    <h2 class="entry-title"><?php the_title(); ?></h2>
    <?php } else { ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php } ?>

    Also in loop-single.php

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

  10. portermonkey
    Member
    Posted 3 years ago #

    thank you

  11. cangpo
    Member
    Posted 3 years ago #

    You are welcome, <h1> tags are very common in the theme, not only in loop-page.php and loop-single.php. Like zoonini said

    heading tags like <h1> and <h2> are in the HTML contained in your theme files - index.php, single.php, loop.php, etc.

Topic Closed

This topic has been closed to new replies.

About this Topic