Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1012537
    karankumar
    Participant

    Is there a way to use Dropcap so that the first letter of every post is enlarged? We would rather not have to go into every post and add it in manually.

    We are using the Ethos stack.

    #1012562
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! This might not be possible because you will not know what is the very first letter of your post. The dropcap needs to be applied at the very first letter. Perhaps, you can try using this code:

    function add_dropcaps($content) {
      if( is_single() ) {
        $string = strip_tags($content);
        $sub = substr($string, 0, 1); 
        $content = str_replace($sub, "", $content);
        $sub = '[dropcap]' . $sub . '[/dropcap]';
      }
      return $sub . $content;
    }
    add_filter('the_content', 'add_dropcaps');

    There is no guarantee that this will work 100%. As this is all custom development, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.

    Thank you for your understanding.

  • <script> jQuery(function($){ $("#no-reply-1012537 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>