Forum Replies Created
-
In reply to: Create a new forum on each new post?
I would like the first forum topic created to be displayed on the post page.
You need to add another line of code to action function. We need to save topic id to post meta.
whole function.php
// Add the hook action add_action('transition_post_status', 'send_new_post', 10, 3); // Listen for publishing of a new post function send_new_post($new_status, $old_status, $post) { if('publish' === $new_status && 'publish' !== $old_status && $post->post_type === 'post') { $my_post = array( 'post_title' => $post->ID, ); $forum_id = bbp_insert_forum($my_post); $my_topic = array( 'post_title' => $post->post_title, 'post_content' => $post->post_content, 'post_parent' => $forum_id ); $topic_id = bbp_insert_topic($my_topic); update_post_meta( $post->ID, 'forum_first_topic', $topic_id ); } }
In single.php we can call your shortcode for showing topic by id because whe have post meta.
Paste this into loop:
$topic_id = get_post_meta( get_the_ID(), 'forum_first_topic', true ); echo do_shortcode(' [bbp-single-topic id='.$topic_id.']');
Whole single php loop:
<?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <div class="article"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?> <h2>Forum: <?php echo basename(get_permalink()); ?></h2> <?php $post = get_post(get_the_ID()); $mypost = get_page_by_title(get_the_ID(),OBJECT,'forum'); $topic_id = get_post_meta( get_the_ID(), 'forum_first_topic', true ); echo do_shortcode(' [bbp-single-topic id='.$topic_id.']'); echo do_shortcode( '[bbp-single-forum id='.$mypost->ID.']' ); ?> </div> <?php endwhile; ?> <?php endif; ?>
In reply to: Create a new forum on each new post?How do I add the post content to the first post of the new topic?
Under this action:
add_action('transition_post_status', 'send_new_post', 10, 3);
Replace with updated function:
// Listen for publishing of a new post function send_new_post($new_status, $old_status, $post) { if('publish' === $new_status && 'publish' !== $old_status && $post->post_type === 'post') { $my_post = array( 'post_title' => $post->ID, ); $forum_id = bbp_insert_forum($my_post); $my_topic = array( 'post_title' => $post->post_title, 'post_content' => $post->post_content, 'post_parent' => $forum_id ); bbp_insert_topic($my_topic); } }
In reply to: Create a new forum on each new post?How do I append the post post title to the forum id?
Change this
<h2>Forum: <?php echo get_the_ID(); ?></h2>
to this:<h2>Forum: <?php echo basename(get_permalink()); ?></h2>
In reply to: Create a new forum on each new post?Here is your theme, if you have any question, just ask me.
In reply to: Create a new forum on each new post?Home Page
https://ibb.co/8Mpg1hgDedicated forum for your review
https://ibb.co/JnBwV9TIn reply to: Create a new forum on each new post?Do not worry, I will explain all details.
In reply to: Create a new forum on each new post?I do not use slack, BTW, I love https://matrix.org/ messenger.
I will do it for you and notify you here in this topic.
I will do simple theme to demonstrate what you need from scratch with this functionality, is it ok for you?
yes, it is possible. Try to wireframe what you need, how, where. I can help
In reply to: Open/Close Children CommentsConfused a bit, can you elaborate a bit?
In reply to: H3 display noneIt isnt. It depends on your theme, how it is used.
In reply to: Looking for a featureYou need to turn on embed functionality. it will translate link to post block.
In reply to: Create a new forum on each new post?I can help, you need to use hooks. If post is created, create a forum like post id of movie review. Then call shortcode with dynamic id of ppost form which is same as pos id of review.
If you need code, contact me.
In reply to: Forum Link Not Working Properly for Some UsersIs it commercial theme?
In reply to: threaded (nested) replies and paginationSURE, Is it custom theme free theme? Or commercial?
In reply to: Image at left of forum<img src="img.jpg" style="float:left;">
In reply to: forum sidebar not displayed on all bbpress pagesCheckout template files for bbpress in theme directory, then just call widgets and sidebars you want That way you can customize whole bbp subpage s.
In reply to: Can users have a follow option in the bbpress forumYes, but you must have plugin buddypress as well. bp-follow plugin in wp plugins directory is available.
In reply to: How to make roles (bbPresss)Discuss with codex of WordPress. add_role function could help.
In reply to: CREATE NEW TOPICMaybe resposive design. It is hidden for small screen devices. Chceck css files.
In reply to: TOPIC FORM RE-SIZEPATH:
includes/class-wp-editor.php
Line 74: elseif ( $set[‘editor_height’] > 5000 )
Line 75: $set[‘editor_height’] = 5000;if you change the last 5000 on line 75 to a smaller number – say 300 or whatever you prefer – then save the file, the ginormous box will re-size to that height.
Good Luck
Is your login form a widget? It looks like. Go to widgets menu and in settings or options there is url to homepage after log in which is default behavior. Try to use bbPress Login widget and check settings.
Good Luck.