Is there a way to show a different main logo in the header (top left) when browsing threads within a certain category or their sub categories? Thank you.
I believe the body includes a class category-{category here}, which you could use to change category specific CSS.
I don’t know how to execute a script after the page content have loaded (I’m interested to know that too!), but for changing the logo image, you could do this:
// in a condition like if category == "somecategory" then…
document.getElementById("#site-logo").src = settings.theme_uploads.logo_cat1;
where logo_cat1 is the variable name of a custom logo:

لقد واجهت هذه المشكلة مؤخرًا أيضًا. أدرك أن هذا موضوع قديم، ولكن إليك حل في حال صادف شخص ما.
يمكنك استخدام CSS والاستفادة من الفئات الموجودة في عنصر body لاكتشاف الفئة التي تنتمي إليها.
// لا تعرض شعار الموقع العادي
body.category-something #site-logo {
display: none;
}
// اعرض صورة أخرى في العنوان
body.category-something .home-logo-wrapper-outlet {
height: 50px;
width: 100px;
background-image: url($category-something-image);
}
آمل أن يكون هذا منطقيًا ![]()
أعتقد أنك ستحتاج إلى وضع صورتك على عنصر <a>، وإلا فإن رابط الشعار سينهار.
// عرض صورة أخرى في العنوان
body.category-something .d-header .title a {
...
}
آه، صحيح، كنت أركز في الغالب على محددات CSS. شكرًا لتصحيح ذلك.
إعجاب واحد (1)