How to hide element?

All good hour. I apologize in advance, perhaps the question already was - did not find. Are the following, all pages are generated from database (implemented in Yii) on every page the widget is placed on top (picture + table). On 2 pages in the database has id (50 and 51) it is necessary to remove a picture from this widget. How better to do is to register in CSS
display:none
or condition in the controller PHP. Himself more inclined to the CSS - the question is how to bind id in the description of the styles?
You should get something like this:
.main-photo {
display:none;
} - this is a General rule for all pages
But for an individual ID
page-id-51.main-photo {
display:none;
}

The screenshot below
5c98df6b1e987912616646.jpeg
March 19th 20 at 08:30
1 answer
March 19th 20 at 08:32
Solution
You can pass in the view option and it just vivait css, it is possible for JS to hide.
You can view and code view? Can the widget pass the parameter to display\no?
I do not quite understand that view? - Nikki commented on March 19th 20 at 08:35

Find more questions by tags CSS