• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.
Resource icon

HowTo: Add XF Discussion Links to bottom of WordPress Blog Post

Step 1. Open your comments.php file in WordPress child theme.
Step 2. Add the php code to the bottom of the file.

PHP:
<?php
global $XF;
if (function_exists('xenforo_thread_url')) {

if (comments_open() && post_type_supports(get_post_type(), 'comments')) :
  $link = xenforo_thread_url();
  if ($link != '') {
  ?>
  <a class='xf-link' href="<?php echo xenforo_thread_url(); ?>">This story is also in our forums</a></p><br class='clear'>
  <?php
  } else {
  ?>
  <p><?php _e('Comments are closed.', 'twentyeleven'); ?></p>
  <?php } endif;
}
?>

Instead of $XF->createLink the $link was hard coded to /community/threads/. This makes sure that the domain name is not included in the link.
Author
LPH
Views
277
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from LPH

Latest updates

  1. Fixed Instructions

    The function must be added to the WordPress child theme comments.php file to display a link to...
Top