Notifications
Clear all

'More discussion »' link all over the website

10 Posts
3 Users
1 Reactions
515 Views
Posts: 9
Topic starter
(@sneakerforum)
Active Member
Joined: 9 months ago

Hello,

I just installed wpForo Blog Cross Posting and it's working fine. However when I select the option Display Cross-posted Topic Link on Blog Post, it will display this link a multiple times across the website.

I'm using Avada theme and Avada builder. And it seems to be showing up at the end of every container.
The website is still in maintenance mode, so it difficult to share a direct link so I made a screenshot. 

www.sneaker forum.nl 2023 12 nike dunk mid panda fq8784 100

You can see two 'More discussion »' links above the post, the correct one underneath the gallery and way down to the bottom of the page another one.

9 Replies
Astghik
Posts: 6149
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Could you please provide the URL where we can see the issue?  

Reply
2 Replies
(@sneakerforum)
Joined: 9 months ago

Active Member
Posts: 9

Posted by: @astgh

Could you please provide the URL where we can see the issue?  

Home - Sneaker Forum (sneaker-forum.nl)

Here you can see the 'This article is also published as a forum topic here »' underneath the post on the homepage.

https://www.sneaker-forum.nl/2023/12/nike-dunk-mid-panda-fq8784-100/

This is the post I cross-posted with the forum. The button with 'This article is also published as a forum topic here »' is everywhere on the page. 

The only place I want this button is in the right corner underneath the post.

 

Reply
Customer
(@tutrix)
Joined: 5 years ago

Member
Posts: 74

Hi @sneakerforum 

add it to custom css

.fusion-tb-header .wpfcp-article-info, 
.fusion-page-title-bar.fusion-tb-page-title-bar .wpfcp-article-info {display: none}

Dashboard > wpForo > Settings > Colors & Styles > Custom CSS

Reply
Posts: 9
Topic starter
(@sneakerforum)
Active Member
Joined: 9 months ago

Great! That does the job. Is there also a code for the  'This article is also published as a forum topic here »' button on the frontpage?

Reply
2 Replies
Customer
(@tutrix)
Joined: 5 years ago

Member
Posts: 74

@sneakerforum 

use this code instead of the above

.fusion-tb-header .wpfcp-article-info,
.fusion-post-cards .wpfcp-article-info,
.fusion-page-title-bar.fusion-tb-page-title-bar .wpfcp-article-info {display: none}
Reply
(@sneakerforum)
Joined: 9 months ago

Active Member
Posts: 9

Posted by: @tutrix

@sneakerforum 

use this code instead of the above

.fusion-tb-header .wpfcp-article-info,
.fusion-post-cards .wpfcp-article-info,
.fusion-page-title-bar.fusion-tb-page-title-bar .wpfcp-article-info {display: none}

Thanks! 

 

Reply
Posts: 9
Topic starter
(@sneakerforum)
Active Member
Joined: 9 months ago

Found two more buttons at the bottom of the article/post (above and underneath the footer).
Can you remove these also?

https://www.sneaker-forum.nl/2024/02/air-jordan-1-high-og-wmns-dusted-clay-fq2941-200/

Reply
1 Reply
Astghik
Admin
(@astgh)
Joined: 7 years ago

Illustrious Member
Posts: 6149

@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 . ' &raquo;</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;}
Reply
Posts: 9
Topic starter
(@sneakerforum)
Active Member
Joined: 9 months ago

Thanks for the reply and effort!

Reply
Share:
Scroll to top