Blog Comments Tabs

Embed Disqus, forum replies, and other conversation platforms to your comments section.

Preview PHP
Click to copy

Paste the following into your functions.php file (easy), or to loader.php (advanced)

<?php
/**
 * Manipulate page templates.
 *
 * @since 1.0
 */

function md_child_templates() {

	// Load new tabs
	if ( md_has_comments() ) {
		add_action( 'md_comments_tabs', 'md_comments_wp_tab' );
		add_action( 'md_comments_tabs', 'md_child_disqus_tab' );
		add_action( 'md_hook_comments', 'md_child_disqus_embed' );
	}

}
add_action( 'template_redirect', 'md_child_templates' );

/**
 * Disqus tab link.
 *
 * @since 1.0
 */

function md_child_disqus_tab() { ?>
	<span id="md_disqus_tab" class="comment-tab md-tab active" data-tab="md_disqus" data-post-id="<?php echo get_the_ID(); ?>"><i class="md-icon-comments"></i> <?php echo __( 'Disqus', 'md-child' ); ?></span>
<?php }

/**
 * Disqus embed code.
 *
 * @since 1.0
 */

function md_child_disqus_embed() { ?>

	<div id="md_disqus" class="disqus-comments active block-mid-tb block-full-lr md-tab-content">
		<p>Enter Disqus embed code here.</p>
	</div>

<?php }

How to Add Comment Tabs for Multiple Comments Plugins

Most comments plugins take over the default comments section, but sometimes you want to offer multiple comments sections for your forums, Disqus, and other kinds of discussion features.

With a few simple actions in MD you can bypass this limitation and embed conversation platforms from others sites without losing your hard earned blog comments.

MD Update in Progress

The new private MD account area is currently being rolled out—follow the beacon to login and see what's new!

Labs

Get the latest MD sent straight to your inbox

There's always something new in the works in the MD Labs! Join the email list to get the newest content and releases sent straight to your inbox.*

Join the MD Newsletter

* I only email you when there's something new, or to share an exciting MD sneak peak.