Forums

add_filter ONLY for is_single (3 posts)

  1. salparadi
    Member
    Posted 7 years ago #

    I've written a plugin to add a dropcap to the first letter of all my posts. At present it applies to pages as well as posts, I only want it to display on Posts.

    i tried this

    if (is_single()) {
    add_filter('the_content', 'drop_cap');
    }

    in the plugin, but obviously that doesn't work. is there a way to do this that i'm just not seeing? thanks for any help!!

  2. Ryan Boren
    WordPress Dev
    Posted 7 years ago #

    Do the is_single() check inside of drop_cap().

  3. salparadi
    Member
    Posted 7 years ago #

    something i should have tried long ago, sometimes i surprise myself with idiotic questions. thanks very much for the quick response!!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.