Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

How to remove featured picture from posts?

  • #8422
    Avatar photo[anonymous]

    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 photo[anonymous]

    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 photo[anonymous]

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