• Resolved bankimoon

    (@bankimoon)


    Hi,

    I’m looking for show one of my custom metabox on all my pages except one.
    At the moment, it’s on all pages, but i can’t find a way to hide it on my contact page.

    I was looking for a function like :
    “->Hide_on_page($page_ID)”
    to replace
    “->show_on_page($page_ID)”.

    here’s my metabox’s code :

       
    Container::make('post_meta', 'Ajouter un bloc')
        ->show_on_post_type('page')
        ->add_fields(array(
            Field::make('complex', 'page_bloc', 'Nouveau bloc')
                ->add_fields(array(
                    Field::make('rich_text', 'bloc')
                ))
        ));

    You have a very good plugin !

    Thx

    Bankimoon

    • This topic was modified 8 years ago by bankimoon.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author htmlBurger

    (@htmlburger)

    Hi @bankimoon, glad you like the plugin!

    Hide on page is not supported at the moment, but its a really good feature suggestion. We will add it to the features list and implement it in a future version, maybe also add more hide_on_* methods. So thanks for the suggestion!

    Plugin Author htmlBurger

    (@htmlburger)

    On the side note, you can try using the hide_on_template('template-contact.php') and make your contact page an actual template. Not sure if this makes sense in your theme, but its the only option at the moment…

    Plugin Author htmlBurger

    (@htmlburger)

    We opened a Github ticket for this feature, you can track the progress here: https://github.com/htmlburger/carbon-fields/issues/122

    Hi @bankimoon,

    I am trying to solve this same issue. Did you ever end up coming up with a solution?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show_on_pages(all exept one)’ is closed to new replies.