Sign in

How to remove featured picture from posts?

  • This topic has 2 replies, 2 voices, and was last updated 1 month, 2 weeks ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8422
    Avatar photoAl

    Hi,

    We are using the latest publii with taste theme. How should I hide the featured image only from the posts?

    Can I suggest you to further consider to put a simple button on/off/custom change pic in the GUI for this in the future versions?

    thanks for developing Publii:)

    #8596
    Avatar photocandidexmedia

    Hey Al!

    I’ve done this a number of times, and also agree that hiding the cover image should be part of the themes.

    Here’s what to do:

    Create an override theme folder, if you haven’t already. You’ll want to override config.json (mandatory) and assets>css>main.css / Custom CSS.

    In your override folder, open config.json in the editor of your choice. Search for “postConfig”, and edit the “featuredImageWidth” section so that it matches below:

    "postConfig": [
            {
                "name": "featuredImageWidth",
                "label": "Featured Image width",
                "value": "post__image--wide",
                "type": "select",
                "options": [
                    {
                    "label": "None",
                        "value": "post__image--none"
                    },
                    {
                        "label": "Normal",
                        "value": "post__image--normal"
                    },
                    {
                        "label": "Wide",
                        "value": "post__image--wide"
                    },
                    {
                        "label": "Full",
                        "value": "post__image--full"
                    }
                ]
            },

    Essentially, you’ll want to add the { “label”: “None”, “value”: “post__image–none” } part.

     

    Next, you can either edit the main.css OR add some custom CSS from inside the Publii app (Tools & Plugins > Custom CSS). In either case, you’ll want to add the following:

    .post__image--none {
      display: none;
    }

     

    #8599
    Avatar photocandidexmedia

    Once you’re in the post editor, you’ll see an option to display “None” images

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