• Resolved stardeuche

    (@stardeuche)


    Hi,

    i want put a slider in my front-page.php. This template is managing by a “Accueil” page in my back office.

    my code is here :

    /*Metaboxe slider*/
    Container::make('post_meta', 'Slider Header')
        ->set_context('normal')
        ->set_priority('high')
        ->show_on_post_type('page')
        ->show_on_page('accueil')
        ->add_fields(array(
            Field::make('complex', 'crb_slider_header')->add_fields(array(
                Field::make('image', 'Image')->set_value_type('url')->help_text('Pour la bonne tenue du slider choisir une image aux dimensions suivantes : 1600px X 600px')
            ))
        ));

    in my other project this code had run but now in my new project i can put the complex filed slider in my “accueil” page. in a “show_on_page” i must put a slug but for home page there is not slug. i try with this code :
    ->show_on_page(‘/’)

    i try this code with a other slug page and this code works (for example for my page “architecture”)

    but it did not work

    have you got an idea for my problem ?

    thanks so lot

    https://wordpress.org/plugins/carbon-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter stardeuche

    (@stardeuche)

    Ah yeees, i resolve the problem

    in the show_on_page, i must put the id of page and not the slug.

    now it’s working

    sorry for inconvenience

    Plugin Author htmlBurger

    (@htmlburger)

    Hi @dewy

    Glad to hear that you managed to resolve the issue.

    We will update the documentation to make it more clear that show_on_page can also accept page IDs, so thanks for bringing that to our attention!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘problem with slug home page’ is closed to new replies.