Site logo

[Support request] Elements – Hook

Home Forums Support [Support request] Elements – Hook

Home Forums Support Elements – Hook

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2483191
    Nadine

    Hello, I want to add one css class to all posts, not pages. Is that possible with Elements / Hook? And how it works?

    #2483233
    David
    Staff
    Customer Support

    Hi there,

    create a Hook Element.
    Add the CSS styles inside style tags eg.

    <style>
    .element {
        color: #f00;
    }
    </style>

    Set the the Hook to: wp_head
    Set the Display Rules to: Posts -> All Posts

    #2491128
    Nadine

    Hello David, thank you for your feedback. But that isn´t what I want to do. I only want to add one class (example class=”test”) for some articles and sides without style. Because css-style I want to write only on one places: in my style.css of child-theme

    #2491317
    David
    Staff
    Customer Support

    The Elements module can only Hook in HTML/Content.
    It can’t filter HTML to add the class. You would need to use the body_class filter hook.

    Question – how will you determine which posts are to be given the particular class ?
    For example: Posts with a specific Category Term.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.