• Resolved justwander

    (@justwander)


    Hello,
    I need to remove the page title from my homepage. The code I used is suppose to jump over the IF statement that renders the title. It is not working.

    Here is what I did:

    <div class="entry-header">
    	<?php
    	if (! is_home()) { 
    		if (! is_single()) :
    		the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
    					
    		else: 
    		the_title( '<h2 class="entry-title">', '</h2>' );
    					
    		endif; }
    	?>
    </div>

    (This is a change to the Writtee theme but since it is a coding question I put it here. Hope it’s OK, I’m new here and don’t know my way around yet.)

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator t-p

    (@t-p)

    Your currently used theme is not in the www.ads-software.com/themes/ directory:
    https://www.ads-software.com/themes/search/Writtee/
    – If this was a custom theme, you may have to go back to your developer team and ask them to make the necessary change(s) to the theme.
    – For pro or commercial product support please contact the author directly on their site. Commercial products are not supported in these forums. As you are their customer I am sure they will have no problem supporting you there.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Something like this:

    if ( is_home() || is_front_page() ) {
        don't display_title();
        }
        else {
        the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
        }
    
    Thread Starter justwander

    (@justwander)

    Sorry t-p, I misspelled it. It came from, https://www.ads-software.com/themes/search/writee/

    Steve, what I’m trying to do is ignore the second IF statement all together. What I want the PHP to say is:

    “If this is not the home page go in and set the title.”

    The silly thing is I did have it working. Then I changed it and went to bed. Unfortunately, I forgot how it looked when I got back to it.

    • This reply was modified 7 years, 1 month ago by justwander.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    if ( ! ( is_home() || is_front_page() ) ) {
        the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
        }
        else {
           do_nothing_here();
        }
    Thread Starter justwander

    (@justwander)

    Thank you Steve, it works perfectly.

    Question, would both of these statements…

    if ( ! ( is_home() || is_front_page() ) ) {
    and
    if ( !is_home() || !is_front_page() ) {

    …be the same?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    No. Check your college logic textbook

    NOT (A or B) == (NOT A) and (NOT B)

    Thread Starter justwander

    (@justwander)

    Ummm…
    I don’t think I have a college logic textbook.

    Guess I didn’t go to the same college as you.

    Thanks!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I still have nightmares about my sophomore year symbolic logic final.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Skip over page title on homepage – PHP question’ is closed to new replies.