• Hi, i’m struggeling with one challenge to do in my custom theme. I want to have content specific controls in my Theme Customizer. I know there is option “active_callback”, but this is not sufficient for my purpose and i read 2 documentation articles about customizer and this https://make.ww.wp.xz.cn/core/2014/07/08/customizer-improvements-in-4-0/ article, but still have no clue, here is what i want to achieve:

    For example, i want to have “show sidebar” checkbox, but this checkbox should be more contextual specifix. For example, when i will be on homepage, there will be just one checkbox as “Show sidebar default” but when i will go into some post, i want there 3 checkboxes:

    1. “Show sidebar default” – id=”show_sidebar”
    2. “Show sidebar in Post archive page” – id=”show_sidebar_archive_{post_type}”
    3. “Show sidebar for this post” – id=”show_sidebar_singular_{post_id}”

    So when i want to have this kind of specific IDs for control, just active_callback is not enought, becauce it can just show/hide controls, i can’t create new when URL in iframe changes.

    There could be 2 sollutions:
    1. Better – when i could somehow create/remove controls by context, it would be best solution. If it’s somehow possible with customizer API, give me som hint please
    2. Not good, but sufficient – is at least possible somehow reload whole /wp-admin/customize.php?url= with new clicked url? this could be enought for a while

    thx for any advices!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Customizer content specific controls’ is closed to new replies.