• Resolved lucapoe

    (@lucapoe)


    Is there any way to hide all the core buttons block with no url?

    The Case:

    So I have a “template post” for a few authors. The way it works is the author will duplicate the post with plugin and edit the post. One of the part of the post is a buttons block with 2 button. But not all the post will have both buttons, or sometimes the post not need button at all. And the authors sometime not woprdpress savvy enough to delete the button.

    Fromthe example, the 1st button contain link (to a youtube video), and the 2nd doesn’t have link. How I hide the empty link button, like from theme functions.php? Is that possible?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • @lucapoe, there is a simple CSS answer for this

    a:not([href]) {
    	display: none;
    }

    That will check if the href doesn’t exist on a link (like in your test post) and hide the button accordingly. A better solution would be to teach your authors how to delete a button, as it’s not that hard, and it will not add unnecessary elements to your HTML.

    Thread Starter lucapoe

    (@lucapoe)

    Wow thanks, I never knew there’s simple CSS solution for this!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Core Button block with no url’ is closed to new replies.