Site logo

Archived topic

CPT content layout + adding css class

3 replies · Started by Morgan on July 23, 2019

Viewing posts 1–4 of 4

Wondering if you can suggest a simple way to achieve the below.

I'm using plugin Helpie FAQ, which creates CPT FAQ pages, pages which appear in a JS accordion faq list, and search results.

It seems stable and simple enough, yet there are no unique CSS classes in the pages it creates.

Things I've done to try and distinguish the FAQ pages from others:

I'm probably approaching this all wrong, and hoping someone could suggest a simple fix?

Also, the Archive layout David helped with breaks anything without a featured image (bcoz .inside-article .entry-header { top: -137px; margin-bottom: -137px;}), which includes these FAQ pages, can I change/add CSS to adjust anything without a featured image?

Hi there,

Do you know which pages you're targeting exactly? The <body> element has a unique class for each page with its ID, so you can use that to style things for specific pages only.

Try this CSS instead:

.inside-article .post-image + .entry-header {
    top: -137px;
    margin-bottom: -137px;
}

EDIT: I should have said there ARE unique classes, but none for the featured image on the FAQ pages (which is the simplest way of achieving what I want).

But I've wrangled more css control of featured images on the Archive and individual FAQ Pages, which is ultimately simpler across myriad page sizes (instead of hiding feat imgs and further wrangling css).

An example page was listed above: https://storyclusters.com/helpie_faq/do-i-write-my-own-script/#more-22040.

So if I wanted to target featured images within the FAQs template, I would do this:

.single-helpie_faq .featured-image

This archived topic is closed to new replies.