@sneakerforum,
Somehow the the_content function is called multiple times, resulting in duplicate links being displayed.
To resolve this issue you can use one of the options provided below.
Option 1:
1. Navigate to the Dashboard > wpForo > settings > "Forum - Blog" Cross Posting admin page and disable the "Display Cross-posted Topic Link on Blog Post" option.
2. Insert the following code into the active theme's functions.php file:
add_action( 'wp_head', 'twentynineteen_colors_css_wrap' );
add_shortcode('wpf_crossposting_link', 'wpf_display_crosspost_link');
function wpf_display_crosspost_link() {
if(!function_exists('WPF') || !class_exists('wpForoCrossPosting')){
return;
}
global $post;
$content = '';
$postID = $post->ID;
$boardids = get_post_meta($postID, '_wpforo_boardids', true);
if (!$boardids) {
$boardids = [];
$boardids[] = 0;
}
foreach ( $boardids as $boardid ) {
$board = WPF()->board->get_board( intval( $boardid ) );
if ( ! $board ) {
continue;
}
WPF()->change_board( $boardid );
if ( ! wpforo_is_module_enabled( WPFOROCROSSPOST_FOLDER ) ) {
continue;
}
$prefix = WPF()->generate_prefix( $boardid );
if (is_singular() ) {
$topicID = get_post_meta( $postID,
'_' . $prefix . 'crossposting_topicid',
true );
$isCrossPostingDisabled = get_post_meta( $postID,
'_' . $prefix . 'crossposting_disabled',
true );
if ( $topicID && ! $isCrossPostingDisabled ) {
$linkText = wpforo_phrase( 'This article is also published as a forum topic here', false );
$topicURL = wpforo_topic( $topicID, 'url' );
$content = '<div class="wpfcp-article-info">';
$content .= '<a href="' . esc_url( (string) $topicURL ) . '">' . $linkText . ' »</a>';
$content .= '</div><div class="wpfcpcb"></div>';
}
return $content;
}
}
}
3. Use the shortcode within the post content:
[wpf_crossposting_link]
Option 2:
The CSS code can be used as well:
.fusion-tb-footer.fusion-footer .wpfcp-article-info, #content .wpfcp-article-info {display:none;}
#content .post-content .fusion-content-tb .wpfcp-article-info{ display:block !important;}