0

If I want to use a same widget but when the post page type different, I would like to show header and footer in different style. Can I change the appearance through the widget? If it's not a good way, what is the best way to do it. Thanks in advance.

0

1 Answer 1

0

I would say it is not good practice to use a widget to change appearance of other items than the widget itself.

If you want to influence the appearance for a specific post type, you can work with post templates.

archive-{post_type}.php
single-{post_type}.php

If such a template file is in use, there is also a class added to the body element single-{post_type}. You can then refer to this class in CSS:

.single-post_type .footer {

}

If you really just want to change the appearance for one specific page, just use the post-id or page-id which are added to the body element's class:

.postid-## .footer {

}

.page-id-## .footer {

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.