عرض محتوى ما بعد الرأس في صفحة الهبوط فقط

مرحباً بالجميع، لدي محتوى يظهر بعد الترويسة أريد عرضه فقط في صفحة الهبوط.

حالياً، يمكنني إنشاء محتوى مخصص لجميع الصفحات الفرعية الأخرى باستخدام فئة الجسم (body class) بهذه الطريقة:

.showthisdiv {display:block;}
body.subpageclass1 .showthisdiv {display:none;}

لكن هذا لن يعمل مع صفحة الهبوط لأن اسم فئة الجسم فيها فارغ كما يلي:

<body class=""> ...

هل يعرف أحد طريقة للتغلب على هذه المشكلة؟ لقد بحثت خلال اليوم أو اليومين الماضيين، لكن لم أستطع العثور على حل.

تعديل
المنهجية المذكورة تعمل كما هو موضح في هذا المثال التفاعلي:
https://jsfiddle.net/endormoon812/dxo5710z/7/

Try using body[class=""] as your selector. It should select only the pages where body has an empty class.

Thank’s for the response! Getting closer, however, I just tried it and it didn’t work. Can you show me how it would look in the context of my sample CSS?

On the plus side though, this is how you can create header content specific to a page.

I’m not finding the body class on the homepage to be blank. The classes that are present depend on whether or not there is a logged in user, but either the class navigation-categories or the class navigation-topics should be present.

If your homepage is displaying categories, you may be able to target that page with .navigation-categories. If your homepage is displaying the latest topics, targeting it with CSS may be difficult, because navigation-topics will appear on the latest, top, and unread pages.

I found an article that contained a good solution.

https://meta.discourse.org/t/create-banner-on-top/48099/12?u=clark_varner

Instead of referring to the " " body class I could easily reference all other body classes instead.

Thanks for the help. I really should write a guide for this and put it in the themes section.

Hey Clark, have you made the guide yet? I’d like to take a look. Thanks!