Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #712570

    Dear Enfold

    We need there to be a signature picture at the end of every blog post and are used to using the following code in functions.php file.

    // 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"><img src="http://www.houseofhuber.net/wp-content/uploads/2016/11/Signature_Nad_3_resize_small.jpg"></div>';
        return $text;
    }

    This works fine but, in some blog post overview elements it seems to get confused. See here http://prntscr.com/d7ncdd (home page) or here http://prntscr.com/d7ncrp (“/team” page). It’s important to point out, that this issue applies only to blog posts which have only one column (e.g. here where it is a different blog layout – there is no problem: http://prntscr.com/d7ndlz). Do you know how to fix this issue or if we have to use a different code within enfold to be able to use the signature?

    Thank you very much and best,
    R

    #712649

    Hey eKMUch!

    can u please give us a link of 2 pages 1 that happen and one it is not?

    Thanks a lot

    Best regards,
    Basilis

    #712894

    Hi Basilis

    Thanks for the swift reply, as this is a quite urgent request.

    Sure the links are below in private content (you need to be logged in to see them).

    Thank you very much for helping
    R

    #713630

    Hi Basilis

    Any news on this?

    We’re going online now. That means I had to temporarily remove the code from functions.php in order not to show a distorted page. But we’re still looking for a solution on this.

    Thank you for looking into it,
    R

    #714426

    Hi,

    The function is supposed to append the signature below the “the content” which is working as expected. It’s not working in the grid layout because it’s not using the “get_the_content” function. What do you want to do exactly?

    Best regards,
    Ismael

    #714737

    Hi Ismaesl

    Thank you for your reply. Correct, it is displaying as expected below the content which is fine. This is not the problem. The problem is that the signature is displayed falsely in the “blog post” excerpt element when set to show a preview of posts in one column (not grid layout). It will then show the signatrue-picture below the “read more” button.

    So instead of showing the signature only below the content (thus below the post) it also shows up on a weird place (below the “read more” button). For better understanding here again the two print screens where you see the signature picture popping up:

    On the home page within the first “Blog Post” element with these settings http://prntscr.com/d9vmsm it will look like this: http://prnt.sc/d7ncdd Instead of not showing the signature as it should only show within the blog post itself but not in the blog post element which is set to only show an excerpt.

    The same thing happens also on the team page, as you can see in the print screen here, where the signature is showing although it shouldn’t: http://prnt.sc/d7ncrp

    It’s important to point out, that this issue seems only to occur when the “blog post” element is set to show excerpts in one column. The “blog post” element shows the blog posts correctly (meaning withouth falsely showing the signature in an “excerpt” setting) if the “blog post” element is set to have a “grid layout” as you can see here: http://prnt.sc/d7ndlz

    So the problem is in “non grid” layout with the “blog post” element. Since there it falsely displays the signature picture below the excerpt.

    I hope this clarifies your questions and you can help me with a solution on this.
    Thank you very much and best,

    #715716

    Hi,

    It will display below the “Read More” link because the link is part of “the_content”. To make this simple, please provide a screenshot on where you want the signature to appear.

    Happening here: http://www.houseofhuber.net/ (but only on the first “blog post” element) and here http://www.houseofhuber.net/team/
    Not happening e.g. here: http://www.houseofhuber.net/blog/

    Again, it will not display on grid layouts or columned posts because it’s not using the “get_the_content” function which is prerequisite of using the “the_content” filter.

    Best regards,
    Ismael

    #715830

    Hi Ismael,

    Thank you for your response. Ah now I understand what you mean, sorry.

    The signature should be shown below every individual blog post – two screenshot examples below in private content.

    I tried it with removing “the_content” from the code but then it doesn’t show the signature anywhere :(

    Thank you for your help,
    Raphael

    #716649

    Hi,

    Thank you for the info. Please replace the code with the following.

    // Add Signature Image after single post
    add_filter('the_content','add_signature', 1);
    function add_signature($text) {
     	global $post;
     	if(($post->post_type == 'post') && is_single()) 
        $text .= '<div class="signature"><img src="http://www.houseofhuber.net/wp-content/uploads/2016/11/Signature_Nad_3_resize_small.jpg"></div>';
        return $text;
    }

    Best regards,
    Ismael

    #716989

    oooh! 😍 Works like a charm!!! you’re the best!

    thank you so much!! :)

    all the best,
    r

    #717157

    Hi,

    Great, glad we could help :-)

    Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

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