Support » Themes and Templates » if – is not [template] show title. how? PHP string?

  • Resolved gcoulby

    (@gcoulby)


    This is what I have so far and it’s not working.

    `<?php

    $get_title = the_title();

    if ( ! is_page_template( ‘page-templates/product-page.php’ ) ) {
    echo <h1 class=”entry-title”> . $get_title . </h1>
    }
    ?>`
    I want it to NOT display the title on that, template.

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

    (@anevins)

    Forum moderator

    You’re not wrapping the echo’s HTML output in quotes or apostrophes.
    See http://php.net/manual/en/function.echo.php

    In future, please describe the issue more thoroughly other than, “not working”.

    gcoulby

    (@gcoulby)

    My apologies it was just the php syntax got me again.

    <?php
               if ( ! is_page_template( 'page-templates/product-page.php' ) ) {
             ?>
    
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    
    	  <?php
    	  }
    	  ?>

    here was what I was wanting.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘if – is not [template] show title. how? PHP string?’ is closed to new replies.