Support » Theme: Purple Pro » Hide page titles

  • Resolved David

    (@davidgarner)


    I want to hide the page titles on selected pages (or all would do the trick). I’ve done this on specific pages with a different theme (twentytwelve) by adding this to the child style sheet:
    ‘body.home .entry-header {
    display: none;
    }’

    It appears that Purple Pro simply uses h1 tags for the page titles, though and I don’t want to have to hide all h1 text.

    Any help gratefully appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    But isn’t there only 1 level 1 heading on Pages?
    E.g.:

    .page h1 {
        display: none;
    }

    Thread Starter David

    (@davidgarner)

    Now I feel even more stupid 🙁 If you don’t mind answering another stupid question, where is .page h1 defined? Or am I missing something obvious?

    Thanks for the quick and very helpful response, BTW.

    Thread Starter David

    (@davidgarner)

    Ah, spoke too soon – that hides all h1 text, not just the page title. I was hoping to still be able to use h1 tags, just not have the actual page title display.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I see, I think you’d need to make a Child Theme modification for this. Do you have one, a child theme?

    Thread Starter David

    (@davidgarner)

    Yes, all changes have been made via a child theme.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Copy the ‘page.php’ file and paste it into your Child Theme directory.
    Then edit the page.php file from within your Child Theme and replace all of its code with this:

    <?php get_header(); ?>
    <div class="main">
    	<?php if (have_posts()) while (have_posts()) : the_post(); ?>
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>><div>
    		<h1 class="entry-title"><?php the_title(); ?> <?php edit_post_link(__('Edit this entry', 'purple_pro'), '', ''); ?></h1>
    		<?php the_content(); ?>
    
    		<div id="comments">
    			<?php comments_template(); ?>
    		</div>
    		<p class="pages"><?php wp_link_pages(); ?></p>
    	</div></article>
    	<?php endwhile; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Then you can target ‘.entry-title‘ in your CSS.

    Thread Starter David

    (@davidgarner)

    Thanks – I’ll try that out later today.

    Thread Starter David

    (@davidgarner)

    That worked perfectly – thanks a lot for your help 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hide page titles’ is closed to new replies.