[Resolved] update date on page, how to remove on contact

Home Forums Support [Resolved] update date on page, how to remove on contact

Home Forums Support update date on page, how to remove on contact

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1631079
    Atefan

    Hello,

    i ask once to get the update date on a page and it worked with this php

    /**
     * Page date to page 
     */
    add_action( 'generate_after_entry_header', 'tu_page_meta' );
    function tu_page_meta() {
        if ( is_singular( 'page' ) ) : ?>
            <div class="entry-meta">
                <?php generate_posted_on(); ?>
            </div><!-- .entry-meta -->
        <?php endif;
    }

    but i would like to remove this update date on contact and about page, how to do that?

    Thanks

    #1631528
    David
    Staff
    Customer Support

    Hi there,

    this line:

    if ( is_singular( 'page' ) ) : ?>

    becomes:

    if ( is_singular( 'page' ) && !is_page( array( 'contact', 'about' ) ) ) : ?>

    In the array ie. array( 'contact', 'about' ) make sure those page slugs match your pages.

    #1631594
    Atefan

    Works, Thanks a lot!

    #1631647
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.