• Resolved bargeloobs

    (@bargeloobs)


    I know this question has been asked before because frankly I think I’ve read a hundred different answers, but I’m having trouble finding a solution specific to my theme and it’s actually getting to the point of driving me nuts.
    What I need to do is remove or hide the “Home” title from showing up on my static front page whilst keeping it within the main navigation.
    I have recently switched from the Weaver theme to Wallow and this is where the problem stemed from. My knowledge of coding is limited at best so could you please go easy. After scouring my style.css, index.php, header.php I can’t really find anything close to what people have been suggesting but I’m just wondering if there might be a change made within the page.php that could help. This snippet here looks like something I might need to alter…. I hope.

    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
    <?php the_post_thumbnail( array( 150,150 ), array( ‘class’ => ‘alignleft’ ) ); ?>
    <h3 class=”s”>” rel=”bookmark”>
    <?php
    $post_title = the_title_attribute(‘echo=0’);
    if (!$post_title) { _e( ”, ‘home’ ); } else { echo $post_title; } ;
    ?>

    Any suggestions would really be appreciated, It’s probably a 1 minute job for someone who knows what they’re doing but I’m all out of things to try! Thanks in advance and hopefully someone can rid me of this pesky title. Cheers!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Actually, you’re looking in the wrong template file.

    If you’re using a static Page as your Front Page, then WordPress will look for the following template files, in order:

    1) front-page.php
    2) page.php
    3) index.php

    Your Theme doesn’t have a front-page.php template file, so you need to look in page.php.

    Here’s the section you need:

    <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark">
    	<?php
    	$post_title = the_title_attribute('echo=0');
    	if (!$post_title) { _e( '(no title)', 'wallow' ); } else { echo $post_title; } ;
    	?>
    </a>
    </h3>

    Wrap all of the above code in an is_front_page() conditional, e.g.:

    if ( ! is_front_page() ) {
    	?>
    	<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark">
    	<?php
    	$post_title = the_title_attribute('echo=0');
    	if (!$post_title) { _e( '(no title)', 'wallow' ); } else { echo $post_title; } ;
    	?>
    	</a>
    	</h3>
    	<?php
    }

    Thread Starter bargeloobs

    (@bargeloobs)

    Hi, thanks for your suggestions, sorry that code in the page.php Iv’e listed is the same as yours, I had changed a couple of things whilst experimenting and forgot to change them back.
    I’ve entered the conditional as you’ve stated but end up with
    if ( ! is_front_page() ) { ?>
    actually displaying on the homepage href=”https://www.easydietsreviewed.com/”&gt;
    What am I doing wrong?

    I’ve entered the conditional as you’ve stated but end up with
    if ( ! is_front_page() ) { ?>
    actually displaying on the homepage

    That’s PHP code; it needs to be wrapped in PHP tags:

    <?php
    // PHP code goes here
    ?>

    Thread Starter bargeloobs

    (@bargeloobs)

    This is what I’ve done
    `<?php
    //

    if ( ! is_front_page() ) {
    ?>
    <h3 class=”storytitle”>” rel=”bookmark”>
    <?php
    $post_title = the_title_attribute(‘echo=0’);
    if (!$post_title) { _e( ‘(no title)’, ‘wallow’ ); } else { echo $post_title; } ;
    ?>

    </h3>

    And it returns a syntax error. Sorry Chip you’ll have to bear with me.

    Can you please wrap your code in backticks?

    What is the exact syntax error that you get? It looks like you’re missing the closing brace for the if ( ! is_front_page() ) conditional.

    Thread Starter bargeloobs

    (@bargeloobs)

    The error is..
    Parse error: syntax error, unexpected T_ENDWHILE in /hermes/web01/b2576/moo.ultradociouscom1/easydietsreviewed/easydietsreviewed.com/wp-content/themes/wallow/page.php on line 65

    Yep: ou’re missing the closing brace for the if ( ! is_front_page() ) conditional:

    <?php
    if ( ! is_front_page() ) {
         // code goes here
    } // <---- this is the closing brace that you're missing
    ?>

    Thread Starter bargeloobs

    (@bargeloobs)

    SUCCESS!!! Thanks Chip you’re a legend!
    You don’t know how grateful I am. Cheers!

    Glad to help. ??

    p.s. be sure to mark the topic as “Resolved”, so facilitate others with a similar problem finding an answer.

    Thread Starter bargeloobs

    (@bargeloobs)

    No Worries, Thanks again, keep up the good work ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Hiding the front page title on a static page’ is closed to new replies.