WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] is_single and NOT is_home (8 posts)

  1. zubair04
    Member
    Posted 1 year ago #

    Hi,

    Just currently using an if statement so that the Entry Meta footer (includes all article tags and dates) is not shown on the Excerpt posts list .

    Using the <?php if ( is_single() ) : ?> function currently works , however, as my homepage is an actual page created in wordpress with some content - the entry meta footer is not excluded from this if statement.

    Ive been trying <?php if ( is_single() && !is_home() ) : ?> but hasn't worked.

    Any suggestions as to what else I might be able to try ?

  2. ronangelo
    Member
    Posted 1 year ago #

    Could you post the url?

    Have you tried adding is_front_page

    if ( is_single() && !is_front_page() )
    Or
    if ( is_single() && !is_home() && !is_front_page() )

  3. zubair04
    Member
    Posted 1 year ago #

  4. zubair04
    Member
    Posted 1 year ago #

    Tried those both and I still get the '<footer class="entry-meta">' appearing on the homepage as I've wrapped the php if tags around the entire footer

  5. ronangelo
    Member
    Posted 1 year ago #

    What file did you edit?

    I see that all the content-xxx.php have
    <footer class="entry-meta">
    Why exactly are you trying to remove it?
    I'm not seeing any <footer class="entry-meta"> on excerpts.

  6. zubair04
    Member
    Posted 1 year ago #

    I'm editing content.php

    I've added a border-top to the footer class ="entry-meta", therfore whilst the remaining entry meta data is not displayed in the homepage, the thin grey border-top still remains,

    The <?php if ( is_single() ) : ?> worked fine for the excerpts , which is exactly what i want, but on the homepage you'll notice a very thin grey line under the slideshow.

  7. ronangelo
    Member
    Posted 1 year ago #

    Would hiding it through CSS be acceptable?

    Combining your is_single() solution with
    .home footer.entry-meta {display:none;}

  8. zubair04
    Member
    Posted 1 year ago #

    Ah i've just realised - due to homepage being a page with content - i should be editing Content-Page.php which has its on entry meta footer. I've commented this footer code out and that has resolved the issue.

    Thanks for your help

Topic Closed

This topic has been closed to new replies.

About this Topic