• Resolved sandras21

    (@sandras21)


    I added to functions file of my childtheme following code to display text signature under all posts automatically:

    
    // Add Signature Image after single post
    add_filter('the_content','add_signature', 1);
    function add_signature($text) {
     global $post;
     if(($post->post_type == 'post')) 
        $text .= '<div class="signature"><signature text here></div>';
        return $text;
    }
    

    Once I added that signature about month ago, it worked and displayed full text. Now when I look posts, it does not display full text but cuts beginning of the text. Same thing is happening for 2 different sites (2 different themes). Any idea what could be the problem? Or is there any changes in latest version od wordpress that this signature code is not working?
    Thank you!

    • This topic was modified 8 years, 11 months ago by Jose Castaneda. Reason: added backticks for code
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi @sandras21

    Have you tried deactivating all your plugins to see if that resolves the issue?

    * edit *

    Apologies was looking at wrong tab. 🙁

    Thread Starter sandras21

    (@sandras21)

    Hello!

    Yes, i tried to deactivate and activate and finally found another snippet from web and tried to replace my code in functions file with that one and it worked. At least for now. New code following:

    
    add_filter('the_content','add_signature');
    function add_signature($text){
     global $post;
     if($post->post_type == 'post') 
        $text.= '<div class="signature"> My signature.
    	</div>';
           return $text;
    }
    
    • This reply was modified 8 years, 11 months ago by Jose Castaneda. Reason: added backticks for code
    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Awesome!

    I’m glad you found your solution! Don’t forget to mark the topic as resolved 😉

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

The topic ‘Signature under posts not displaying fully’ is closed to new replies.