How to add a line at the end of all pages?

Goodmorning.
I use that code to add a line at the end of all post.

function diww_add_post_content($content) {
	if (is_single()) {
		$content .= '<p><div id="newsletter-box">? ?????????? ???? ???????????? ?????????. ???????? ???????? ????  <a title="???? ??????." href="">????? ??????</a></div></p>';
	}
	return $content;
}
add_filter ('the_content', 'diww_add_post_content', 0);

How can i do that for pages also.
what do i need to change on that code?
Thanks a lot.

  • Bojan Radonic
    • Head of Support

    Hey there @nicolas, hope you're well today!

    You should be able to achieve that with using is_page() instead of is_single(). Or if you're looking to to display the same thing on both you can simply modify the existing function, something like this:

    function diww_add_post_content($content) {
    	if (is_single() || is_page()) {
    		$content .= '<p><div id="newsletter-box">? ?????????? ???? ???????????? ?????????. ???????? ???????? ????  <a title="???? ??????." href="">????? ??????</a></div></p>';
    	}
    	return $content;
    }
    add_filter ('the_content', 'diww_add_post_content', 0);

    This should display that on both single and page. Please let me know if this helps :slight_smile:

    Best regards,
    Bojan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.