I am building a theme which Theme customizer changes colors, sizes, etc. and has also the option to choose a category and style that category specifically.

How can I display that category in the preview (only when the user is changing the corresponding options) instead of the default home/front page displayed by default?

EDIT

I can access the preview window with customize_preview_init, but I can not apply wp_redirect, which I guess could be a way.

4 Answers
4

If I understand you goal correctly, then will you a select inside the Customizer, there list the Categories and the User can use this for save in your theme settings.

If you will enhance the Customizer for categories, then use this class from this repo here. Include the file and enhacne the default class. You can easy implement a select for the categories of the install. Inside the readme of this repo are two links to gist with a example use, but for other class of the repo. I think is clear and the same way on all extensions for the Customizer.

Leave a Reply

Your email address will not be published. Required fields are marked *