• mjaitly123

    (@mjaitly123)


    Hi

    Can anyone let me know that if I want to add a specific content or an internal link to every blog post without having to type it all the time, how can I do this? The content and link should automatically appear at the bottom of the post when the article is posted.

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    The easiest thing would be to add a content filter, something like

    function my_content_filter( $content ) {
       if ( is_single() ) {
            return $content . '<div class="my_content_filter">whatever html you want here</div>';
            } else {
            return $content;
            }
    }
    add_filter( 'the_content', 'my_content_filter' );

    This would go in a plugin or in your theme’s functions.php.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding to Posts’ is closed to new replies.