Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

Calling wpDiscuz with custom shortcode...

2 Posts
2 Users
0 Reactions
4,664 Views
(@wtwebmaster)
New Member
Joined: 8 years ago
Posts: 1
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#2797]

Hi,

We need to place the Comment block within the Page content.

To do this, I've put together the following shortcode and it works fine, except I'd prefer to be calling wpDiscuz instead of WP's default comment system:

add_shortcode( 'my_comment_form', function( $atts = array(), $content = '' ) {
if( post_type_supports( get_post_type(), 'comments' ) ) {
  ob_start();
  comment_form();
  print( '<style>.no-comments { display: none; }</style>' );
   add_filter( 'comments_open', '__return_false' );
}
return '';
}, 10, 2 );

Essentially, I'd like to replace  comment_form();  from above with a call to wpDiscuz.

 

Thanks!

 



   
Quote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 8 years ago
Posts: 6645
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi wtwebmaster,

wpDiscuz doesn't have shortcode. 

wpDiscuz is designed as a native WordPress comment system. I'm sorry but you can't add it in page content, it's loaded under page content. 



   
ReplyQuote
Share:
Scroll to top