Hello @arsenalemusica, I hope you are doing well today!
1) can you customize the content of the sidebar, like adding html, css, buttons, etc.?
It is possible, but not within the Custom SideBars Settings. You can add CSS classed to your theme editor or use a plugin like the Simple Custom CSS plugin.
If you wish to add buttons, just use a simple Text widget inside the Custom Sidebar and add an HTML code inside.
2) can you show the sidebar by default into a particular type of post, along the entire site? (for instance, on all listing profiles in a listing directory)
Yes, you can show a sidebar by default on a custom post types too. Just edit the Sidebar Location and select “As Sidebar for selected Post Types”.

I hope this will helps!
Cheers,
Nastia
Thread Starter
anonymized-14293447
(@anonymized-14293447)
Thank you for the clarification. One more: can you write PHP code inside the sidebar? You see, I need to add the sidebar to my custom_post_type, but each one of them belongs to a Company and I need to create a button “back to the company”.
Thread Starter
anonymized-14293447
(@anonymized-14293447)
I confirm that you can write PHP only if you enable it in the Widgets, by adding this code to the theme’s functions.php:
// Enable PHP in widgets
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}
Hi @arsenalemusica,
Widgets in custom sidebars are behaving like default widgets, and as you already figured out enabling PHP in widgets is required 🙂
Cheers,
Predrag