How to change the content width using php?

Yes, often the best way is as you describe. In your template file add something like this: <div class=”container-wrap se-366024″> Then in your style.css (or any other enqueued stylesheet) .se-366024 { width:960px; } If you are wanting to set a max width across the site you may want to look into the $content_width global supported … Read more

Display one random image from Media Library

I can’t comment due to lack of reputation, so I’ll address the issue rudtek mentioned. Personally, I never came across a host that disables PHP’s rand() function, but in case there is such a lousy host, you can opt for a more efficient way of doing things. What you can do is to get all … Read more

Posts missing on author page

It’s best not to edit theme files directly, because when you update the theme, your changes are lost. Instead, if you need to change things, create a child theme and you can do whatever you need there. To restore the previous file you can either download a fresh copy of your theme, or look through … Read more

Assign meta_query value to php variable

Sorry if I’m being dumb but your query says that br_type must be equal to esc_attr($values[‘category’]) so to put it in a variable you would just: $br_type = esc_attr($values[‘category’]); Or if you want to get it from $query you would look in one of the places mentioned here: How do I get a meta value … Read more