Forums

[resolved] Hiding page title (4 posts)

  1. paulgul
    Member
    Posted 1 year ago #

    Using the Motion theme, i've created several pages, one of them displays a slideshow. On this page (Home) I don't want the page title displayed but I want the title displayed on other pages.
    I've tried using the If..else function and added this to my page.php.

    <?php if (the_title=="Home") :?>
      		<?php else : ?>
    			<div class="posttop">
    				<h2 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    			</div>
    		<?php endif; ?>

    But it doesn't work, it still displays the title on all pages.
    What I'm trying to say is "If page title = 'Home' then don't display anything, if page title = 'anything else' then display title.

    Am I on the right tracks or am I completly off - any help appreciated
    Paul

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    try it this way:

    <?php if (get_the_title()=="Home") :?>

    or try with the is_page() conditional tag:
    http://codex.wordpress.org/Function_Reference/is_page

    for instance so:

    <?php if ( is_page('Home') ) :?>
  3. paulgul
    Member
    Posted 1 year ago #

    Thanks, that first suggestion worked.

  4. congo181
    Member
    Posted 6 months ago #

    Hi there,

    I'd also like to take out the title on my home page, also using the motion theme, as mentioned above.

    I tried to insert the code above, but didn't have any luck. Any other suggestions? Many thanks for any help you are able give. Site is http://www.timclare.com if you need it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags