WordPress.org

Forums

Twenty eleven (3 posts)

  1. insurgenesis
    Member
    Posted 2 years ago #

    What's the correct way to selectively hide a post titles for posts using css?
    I only need to do this exceptionally on certain posts (not pages) using post ID or similar method.

    (I'm using a child theme)

  2. codingpet
    Member
    Posted 2 years ago #

    use post ID and write the css in your child theme.

    If you don't want to edit style.css so frequently, then you may consider add a custom field to all posts that you want to hide the title. This article will be helpful is you need it in this way. http://wooshift.com/how-to-add-custom-css-for-individual-posts-on-wordpress/

  3. alchymyth
    Forum Moderator
    Posted 2 years ago #

    using the body_class() http://codex.wordpress.org/Function_Reference/body_class output - for the single post only:

    .postid-1234 .entry-title { display: none; }

    or using the post_class() http://codex.wordpress.org/Function_Reference/post_class output - for the single post and the post in a list:

    #post-1234 .entry-title { display: none; }
    or
    .post-1234 .entry-title { display: none; }

Topic Closed

This topic has been closed to new replies.

About this Topic