• Hi,
    I am trying to append a div at the end of the content.
    I succeed to do so in some wordpress blogs, but others simply do not add the div.
    I tested and saw that the my_add_widget function is being invoked in all blogs – but the div is just not appended in some cases.

    Example of blog that do succeed to append the div: http://www.mixedwaves.com/
    Example of blog that fails to append the div:
    http://www.motorbikenews.co.uk/video-samsung-honda-meet-the-raf/

    Code:

    function my_add_widget($content)
    {
    $linkToPost = get_permalink($post->ID);
    $content .= ‘<div id=”ewidget_’. $post->ID .'”></div>’;
    return $content;
    }

    add_filter(‘the_content’, ‘my_add_widget’);

    Any idea why is that?

    Best,
    Anat.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Engageya

    (@engageya)

    Another examples of blogs that do not append the div from the_content

    [irrelevant links moderated]

    It might help if $post was defined.

    Set WP_DEBUG to true in wp-config.php to catch errors like this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Occasionally fail to append DIV at the end of the post with filter the_content’ is closed to new replies.