hellojesse (@egyptimhotep)

Forum Replies Created

Viewing 21 replies - 26 through 46 (of 46 total)
  • @egyptimhotep

    Participant

    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; ?>

    @egyptimhotep

    Participant

    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);
      }
    }

    @egyptimhotep

    Participant

    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>

    @egyptimhotep

    Participant

    Here is your theme, if you have any question, just ask me.

    http://up-4ever.org/d/Ej72

    @egyptimhotep

    Participant

    Home Page
    https://ibb.co/8Mpg1hg

    Dedicated forum for your review
    https://ibb.co/JnBwV9T

    @egyptimhotep

    Participant

    Do not worry, I will explain all details.

    @egyptimhotep

    Participant

    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?

    @egyptimhotep

    Participant

    yes, it is possible. Try to wireframe what you need, how, where. I can help

    @egyptimhotep

    Participant

    Confused a bit, can you elaborate a bit?

    In reply to: H3 display none

    @egyptimhotep

    Participant

    It isnt. It depends on your theme, how it is used.

    In reply to: Looking for a feature

    @egyptimhotep

    Participant

    You need to turn on embed functionality. it will translate link to post block.

    @egyptimhotep

    Participant

    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.

    @egyptimhotep

    Participant

    Is it commercial theme?

    @egyptimhotep

    Participant

    SURE, Is it custom theme free theme? Or commercial?

    In reply to: Image at left of forum

    @egyptimhotep

    Participant

    <img src="img.jpg" style="float:left;">

    @egyptimhotep

    Participant

    Checkout template files for bbpress in theme directory, then just call widgets and sidebars you want That way you can customize whole bbp subpage s.

    @egyptimhotep

    Participant

    Yes, but you must have plugin buddypress as well. bp-follow plugin in wp plugins directory is available.

    @egyptimhotep

    Participant

    Discuss with codex of WordPress. add_role function could help.

    In reply to: CREATE NEW TOPIC

    @egyptimhotep

    Participant

    Maybe resposive design. It is hidden for small screen devices. Chceck css files.

    In reply to: TOPIC FORM RE-SIZE

    @egyptimhotep

    Participant

    PATH: 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

    @egyptimhotep

    Participant

    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.

Viewing 21 replies - 26 through 46 (of 46 total)