Search Results for 'code'
-
Search Results
-
Using this code I am able to programmatically create a forum post, but it only shows to users who are logged in (when using the bbp-single-topic shortcode) How can I get that topics to show while logged out?
function createforumpost($text, $forums_id, $unique_id, $fighter_name = false){ if(is_null($forums_id) || !$forums_id){ if(!$fighter_name){ $fighter_name = explode("-", $unique_id); foreach($fighter_name as $index => $word){ $fighter_name[$index] = ucfirst($word); } } $forum_post = array( 'post_title' => $fighter_name, 'post_content' => $text, 'post_name' => $unique_id, 'post_status' => 'publish', 'comment_status' => 'closed', 'post_type' => 'topic', 'post_parent' => 75857, 'post_author' => 1, ); $forum_post["ID"] = wp_insert_post($forum_post); return $forum_post["ID"]; } return $forums_id; }
Topic: editing registeration form
Hello
I found bbpress registration is used by “form-user-register.php”
I added extra field code (
<div class=”bbp-email”>
<label for=”user_email”><?php esc_html_e( ‘Email’, ‘bbpress’ ); ?>: </label>
<input type=”text” name=”이메일” value=”<?php bbp_sanitize_val( ‘user_password’ ); ?>” size=”20″ id=”user_password” maxlength=”100″ autocomplete=”off” />
</div>)
to edit the registeration form but it didnt work
what is the problem do you think?Topic: bbPress does not work
After I Install and activate bbPress nothing shows up in my admin area sidebar (Forum, Topics, Replies do not appear). When I create a new page and paste there a shortcode for displaying the whole forum index, the page shows an error. I don’t know what went wrong, I tested on my localhost and it worked fine.
I also tried to delete the plugin and install it again.I suppose this isn’t WordPress or BBPress specific, but trying to figure out if there is a WordPress way of doing this.
I am using BBPress, and on some page, such as
https://somesite.com/lesson/some-lesson/
, I have a block with a link to a discussion topic. That link is of form<a href="javascript:void(0);" data-target="#myModal" data-href="somesite.com/forums/topic/required-discussion-1/" data-toggle="modal" class="openPopup"><h3 class="topictype-title">required discussion 1</h3></a>
The modal popup is handled in bootstrap via
<div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog modal-xl"> <div class="modal-content"> <div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Class Discussion</h4> </div> <div class="modal-body"></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>
And with jQuery
$('body').on('click', '[data-toggle="modal"]', function(){ $($(this).data("target")+' .modal-body').load($(this).data("href")); });
What happens now, is after hitting submit, the modal goes away, and the forum topic page with the submitted reply is loaded: url
https://somesite.com/forums/topic/required-discussion-1/#post-25847
The thing is, after user submits from the modal, I want either
**1) the refresh (so, going to
https://somesite.com/forums/topic/required-discussion-1/#post-25847
) to happen in the modal, or****2) for the modal to simply close and user is returned to exactly as they were prior to modal popping up, that is, to
https://somesite.com/lesson/some-lesson/
**Ideas on how to ideally achieve these two behaviors? I have never worked with modals before, so curious what are some best practices here to get the desired behavior.
Thanks!
I know there is a widget to show somewhere on the page if there is new activity in the forums. But is there a possibility (maybe a shortcode?) to show only an icon when there is new activity in any forum? Or better yet an info with the number of new posts?
I’ve been searching for a way to return the titles and links of every topic on my forum. I’m familiar with HTML and CSS, but a PHP novice, which I think is my downfall here.
I found a call to
<?php the_content();?>
which seems to be generating the big grey box with a list of all the topics (image link: https://imgur.com/a/fKamtGH)
However, I just want to return the topic titles and links to each topic, not the entire box. I can’t seem to find / write a PHP method that does this, does anyone have any advice?