• Resolved Pete

    (@perthmetro)


    Hi there, great plugin you have here. I was wondering if I could ask a favour and request a feature. At the moment there’s no way of telling the difference if a post came via Postie or the normal post editor. Would you be able to add a “postie” class so we can apply styling to Postie posts specifically… Thanks heaps.

    Pete

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Wayne Allen

    (@wayneallen-1)

    This would be rather specific to your site and is fairly easy to do via a filter. See http://postieplugin.com/extending/

    add_filter('postie_post_before', 'my_postie_post_before');
    
    function my_postie_post_before($post) {
        $post['post_content'] = '<div class="postie">' . $post['post_content'] . '</div>';
        return $post;
    }
    Thread Starter Pete

    (@perthmetro)

    Thanks for your reply but I’d prefer a CSS class inserted/added into, for example, the “body_class”, rather than having an inline div applied. I’d that possible?

    Plugin Author Wayne Allen

    (@wayneallen-1)

    Postie doesn’t generate the body element, that is the responsibility of the theme.

    Another option is to add a custom field to posts created by Postie, then your theme can change the body class as needed.

    This will only work for the single page view. Your post list will have to be done differently.

    Thread Starter Pete

    (@perthmetro)

    Could you use something like this to insert a postie class into the body class?
    http://wordpress.stackexchange.com/questions/204552/how-do-i-apply-target-css-to-a-specific-user-role-or-roles

    Plugin Author Wayne Allen

    (@wayneallen-1)

    It would not be appropriate for Postie to change the body element in this way. This is the job of the theme. Postie is just a alternative way to create a post. You can’t change the body element in the regular editor.

    You could do this on your site.

    Thread Starter Pete

    (@perthmetro)

    No worries thanks anyway

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Feature Request: Add a css class to posts’ is closed to new replies.