• Welcome to the all-new Kolakube support, the official place to get help for Marketers Delight, XFtoWP, CryptoWP, and other WordPress products! Please login with your account details to access private support forums.

Resolved Change content in the pinned post and exclude it from comment count

Techsense

Member
XFtoWP
Messages
7
Reaction score
1
By default XFtoWP fetches the OP content as the first "reply" in WP" when there're no forum replies. This doesn't make too much sense as the WP post already has the same content. I'd like to add a tailored message to all zero-forum-reply posts. How to get this done? I just want to change the content, nothing else.

Also I want to exclude the first message of all zero-forum-reply posts from the comment count which shows "1", but in fact it should be "0".
 
Solution
But I would suggest to separate the count of forum replies from that of wp comments, as your plugin can be used to deliver distinctive information other than forum discussions.
Yes, XFtoWP adds the total # of thread replies to any given post's comments count including where it renders in templates with get_comments_number().

You can get the total # of thread replies by accessing the wp_postmeta for any post with this helper function:

PHP:
$forum_comments = xf_post_meta( 'total' );

or if you already know the post ID, search that way:

PHP:
$forum_comments = xf_post_meta( 'total', 34535 );

I really need to remove the OP content from the WP posts. Could you please point me which php code I should modify?
...

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,562
Reaction score
1,851
By default XFtoWP fetches the OP content as the first "reply" in WP" when there're no forum replies. This doesn't make too much sense as the WP post already has the same content. I'd like to add a tailored message to all zero-forum-reply posts. How to get this done? I just want to change the content, nothing else.
This was designed back in version 1.0 with the intention of the author writing a different message for the forum thread opening post.

When used to post excerpts and full article lengths, as has proven to be the most common use case, I agree that it should be able to be different than OP.

Currently the only way to do it is to change the OP content on the forum, then the next time your comments refresh it will update the post.

If you'd like to post this to the feature request forum it will be easier to track. I've added it to my notes as it has been requested another time before.
Also I want to exclude the first message of all zero-forum-reply posts from the comment count which shows "1", but in fact it should be "0".
So, without a reply to the thread you are reporting that the pkugon adds a 1 each time you connect a thread with no replies?

If I understand correctly, does the post also have 0 comments? If you have a page like this I can view, it will help me better understand the issue.
 
Comment

Techsense

Member
XFtoWP
Messages
7
Reaction score
1
Hi Alex, I found the second issue turned out to be a negligence of the comment coming with a fresh wp installation. But I would suggest to separate the count of forum replies from that of wp comments, as your plugin can be used to deliver distinctive information other than forum discussions.

I've PMed you the pages to illustrate a totally different use of your plugin. I really need to remove the OP content from the WP posts. Could you please point me which php code I should modify?
 
Last edited:
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,562
Reaction score
1,851
But I would suggest to separate the count of forum replies from that of wp comments, as your plugin can be used to deliver distinctive information other than forum discussions.
Yes, XFtoWP adds the total # of thread replies to any given post's comments count including where it renders in templates with get_comments_number().

You can get the total # of thread replies by accessing the wp_postmeta for any post with this helper function:

PHP:
$forum_comments = xf_post_meta( 'total' );

or if you already know the post ID, search that way:

PHP:
$forum_comments = xf_post_meta( 'total', 34535 );

I really need to remove the OP content from the WP posts. Could you please point me which php code I should modify?
I've just released XFtoWP 1.5 Beta 4 (1.4.94) which offers a new option (and a slight re-wording) to disable the original post entirely.

Download the latest beta from your account area and reinstall the plugin to use it.

Screen Shot 2022-05-05 at 10.54.55 PM.png
 
Comment
Solution

Techsense

Member
XFtoWP
Messages
7
Reaction score
1
Hi Alex.

It's really strange! At the click to a WP post via a link from another page, the original XF post still appears. Upon refreshing the page the XF original post then disappears.

I've PMed you the url.
 
Comment

Techsense

Member
XFtoWP
Messages
7
Reaction score
1
On further investigation, I didn't find the source code for the original XF post despite its showing up in the WP post. I guess the phantom content might be produced by XFtoWP js script.
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,562
Reaction score
1,851
Hi @Techsense, thank you for posting the update and apologies for my delayed reply.

I looked into the behavior and see that the new option is being ignored on the AJAX request after the time interval you set has passed. I have corrected the logic to always hide the first post if the new option is enabled and will send out a patch shortly.
 
Comment
Top