[Resolved] Wanting date ONLY on blog

Home Forums Support [Resolved] Wanting date ONLY on blog

Home Forums Support Wanting date ONLY on blog

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #169768
    robmac

    Greetings,

    Does anyone happen to know any easy way, to REMOVE the date, from posts OTHER than my actual blog? Is there a plugin that will assist, or, would I have to code it, please? Thank you for any guidance offered.

    ie,

    “My Blog” [date to REMAIN]
    posts – category A [Wanting to REMOVE date on posts]
    posts – category B [Wanting to REMOVE date on posts]
    etc
    etc

    Thank you.

    #170072
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The Blog add-on allows you to remove it from all posts and your blog in the Customizer.

    To remove it only within categories, you’ll need to use the available filters with an is_category() conditional.

    I’m away from my desktop right now but can give you some example code as soon as I’m back if you need?

    Let me know ๐Ÿ™‚

    #170473
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Give this a shot:

    add_filter( 'generate_post_date','generate_change_date_display' );
    function generate_change_date_display()
    {
        if ( is_home() ) {
            return true;
        }
    
        return false;
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    #171098
    robmac

    Tom,

    Sorry for delay in replying.

    Sincere thanks, as ever, for your very helpful support.

    Robert

    #171104
    robmac

    Hi Tom,

    What I found works best, for what I want to do is, [with my child theme active] adding to “Simple CSS” the following:

    .entry-meta {display: none;} it removes the date and author from all my posts. However, it also does from my blog, could please suggest some code I could add to the above CSS to exempt a specific category, please?

    Thank you.

    Regards,
    Robert

    #171123
    Tom
    Lead Developer
    Lead Developer

    You can hide it from categories with this:

    .category .entry-meta {
        display: none;
    }

    You can do specific categories with this:

    .category-categoryname .entry-meta {
        display: none;
    }
    #171468
    robmac

    Thanks again, seems to have worked fine!

    #171604
    Tom
    Lead Developer
    Lead Developer

    Awesome ๐Ÿ™‚

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