Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,651 through 6,675 (of 32,519 total)
  • Author
    Search Results
  • #173479
    Robkk
    Moderator

    @bj87

    Do what @casiepa said and just put the bbPress template content-single-forum.php in a folder called bbpress in your child theme, and edit the file.

    A guide like this would help you figure out how you can customize the bbPress default theme in a child theme.

    https://codex.bbpress.org/themes/theme-compatibility/

    Just make your file look similar to this gist.

    https://gist.github.com/robkk/059c1f87b3d21cf75dd9


    @tech55541
    thanks for helping out in a few topics in the support forums, but your code shows undefined messages in the user profile subscriptions section if you are subscribed to a forum.

    #173478
    Pascal Casier
    Moderator
    $current_user = wp_get_current_user();
    $user_id = $current_user->ID;
    if ( 0 == $user_id ) {
        // Not logged in.
    } else {
        // code from previous thread, use function like bbp_get_user_topic_count_raw($user_id)
    }

    Not tested ! But should be in that direction…

    #173470
    tech55541
    Participant

    Hello,
    Couldn’t you still use functions.php with this code to restrict it to BBPress.

    if ( is_bbPress() ):

    Makes since to me.

    Thanks.

    #173469
    tech55541
    Participant

    Hello,
    Please insert this code in a mu-plugin. Using FTP, create a folder named “mu-plugins” in the /wp-content directory without the quotes. Then create a file named what ever you want with a .php extention. For example, example-plugin.php.

    <?php
    add_action( 'wp_footer', 'reposition_selector' );
    function reposition_selector() {
    ?>
    <script type="text/javascript">
    jQuery( document ).ready(function() {
    var htmlString = jQuery('.bbp-topic-form').html();
    jQuery('.bbp-topic-form').css('display','none');
    jQuery( "<div class='bbp-topic-form'>"+htmlString+"</div>" ).insertBefore( "#subscription-toggle" );
    		});
    	</script>
        <?php
    }

    Thanks.

    #173467
    bj87
    Participant

    Help the last time, where should i paste that code you wrote in?

    #173466
    bj87
    Participant

    So where should i place that code again?

    It looks like this in my footer.php at the end, already another script also…

    // Echo the scripts added to the "before </body>" field in Theme Options
    		echo Avada()->settings->get( 'space_body' );
    		?>
    
    		<!--[if lte IE 8]>
    			<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/assets/js/respond.js"></script>
    		<![endif]-->
    	</body>
    </html>
    #173465
    tech55541
    Participant

    Hello,
    I would just edit the template, I could not make my code work either.

    Thanks.

    #173456
    chaya579
    Participant

    i’m used with Content Aware Sidebars to create dynamic sidebars but its not work for bbpress form.
    how can i add specific to bbpress forms?

    tried to add code to bbpress.php and to sidebar.php but still can not add sidebars on bbpress.

    thanks

    #173455
    tech55541
    Participant

    Hello,
    You could try something like this. Place this code before the ending </html> tag in your footer.php file of your theme.

    <script>
    jQuery($('.bbp-topic-form').insertAfter('#subscription-toggle');
    </script>
    #173452
    Pascal Casier
    Moderator

    Hi Johan, goede avond,

    I suppose you can copy the content-single-forum.php to your own child theme and modify it accordingly.
    https://codex.bbpress.org/themes/theme-compatibility/step-by-step-guide-to-creating-a-custom-bbpress-theme/

    Pascal.

    #173448
    Robkk
    Moderator

    @elovkoff

    You do not have to create a child theme just for custom code snippets, you can also use a custom plugin, this plugin below will give you an area to add custom php code snippets.

    https://wordpress.org/plugins/functionality/

    I still rather suggest you just stick with an inline image upload plugin instead of gd bbPress attachments(unless you are using pro), instead of removing the error notice and allowing empty replies.

    #173439
    dalemiles
    Participant

    Hi Pascal,

    Thanks, updating the wordpress profile is not a problem I can do that.

    However using the code from bbPress profile such as:

    <?php do_action( 'bbp_template_before_user_profile' ); ?>
    
    	<div id="bbp-user-profile" class="bbp-user-profile">
        <h1>View Users Trading Profile Here <?php get_the_author_id(); ?></h1>
       
    		<h2 class="entry-title"><?php _e( 'Profile', 'bbpress' ); ?></h2>
    		<div class="bbp-user-section">
    
    			<?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>
    
    				<p class="bbp-user-description"><?php bbp_displayed_user_field( 'description' ); ?></p>
    
    			<?php endif; ?>
    
    			<p class="bbp-user-forum-role"><?php  printf( __( 'Role: %s',      'bbpress' ), bbp_get_user_display_role()    ); ?></p>
    			<p class="bbp-user-topic-count"><?php printf( __( 'Topics Started: %s',  'bbpress' ), bbp_get_user_topic_count_raw() ); ?></p>
    			<p class="bbp-user-reply-count"><?php printf( __( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count_raw() ); ?></p>
    		</div>
    	</div><!-- #bbp-author-topics-started -->
    
    	<?php do_action( 'bbp_template_after_user_profile' ); ?>

    added to my author.php doesn’t work.

    I presume its because its not tied to the bbPress ‘user’ profile?

    #173437
    dalemiles
    Participant

    You sir are a legend, that worked perfectly.

    Would it be hard to put the user details onto my author page?
    (topics created, replies created then a list of each).

    I can create tabs at the bottom like on my current author pages and put the code to show the information in there.

    #173435
    Pascal Casier
    Moderator

    Something like this in your functions.php ?

    add_filter( 'bbp_pre_get_user_profile_url', 'casiepa_custom_author_link' );
    function casiepa_custom_author_link( $user_id ) {
    	return get_author_posts_url( $user_id, '' );
    }
    #173428
    dalemiles
    Participant

    Hey guys.

    I’ve tried searching about this but not really been able to find a definitive answer, especially for my own situation.

    I currently have a live site, where users NEED to use WordPress default domain.com/author/username

    Currently when you go to the profile of a poster in the bbPress forum it takes you to a different user page domain.com/user/username

    I need this to direct to domain.com/author/username as the default WordPress profile contains information about the user (feedback ratings, post details + more – its a classified site).

    Now I’m not 100% fussed on whether the domain.com/author/username page displays post details, as the ‘forum’ I’ve having is a single forum and more like a general chat area of the site. I’m not looking to setup a fully fledged forum.

    However the most important thing is having their profiles direct to their author page instead of their bbPress user page.

    If there is code I can place in the author.php file (WordPress one) that will check their bbPress details regarding their posts, that would be great. I’ve tried copying the code from bbPress user-profile.php but that didn’t work.

    Can any one offer any assistance? I’d deeply appreciate it.

    Thanks

    bbPress: Version 2.5.8
    WordPress: Version 4.4.2
    Website: http://www.airsofttrader.co.nz (You can see the example of author pages, however bbPress is not installed on the live site – its installed locally.)

    #173427
    Robin W
    Moderator
    #173423
    Pascal Casier
    Moderator
    #173410
    Pascal Casier
    Moderator

    You can put any of these codes into your functions.php of your (child) theme.

    #173389
    elovkoff
    Participant

    Thanks Rob. I’m sorry, I’m quite ok with html/css but now close to nothing about php. Can you let me know where would I pace this code?

    Thanks.
    Elijah.

    #173388
    Robkk
    Moderator

    Yeah you do not need to run both plugins at the same time. I meant just use one instead of the other.

    This php snippet will allow empty posts which is kind of not a good idea. Also I cannot seem to find the code in the bbPRess plugin responsibe for the no redirect to post after submit after using using this code.

    function rkk_remove_content_error_check( $reply_content ) {
      if ( !empty( $_POST['bbp_reply_content'] ) && empty( $_POST['bbp_reply_content'] ) )
      $reply_content = $_POST['bbp_reply_content'];
    }
    add_filter( 'bbp_new_reply_pre_content', 'rkk_remove_content_error_check' );
    #173383
    Robkk
    Moderator

    @mimbelli Here is the list of plugins, these could be about 7 plugins in total if you want to do the free route, or 4 plugins in total if you only want to use BuddyPress and GD bbPress toolbox (paid plugin)

    User signature, hot/new/sticky topics (labels/icons??), post count and join date, visual preview could be possible using a small piece of custom code and using bbPress hooks to display them.

    TKServer
    Participant

    I’ve got a header, screenshots, and icon in the assets folder. I made some minor changes to the code and readme text plus has the images in the assets folder and did this:

    svn ci -m “Code cleanup and hopefully screen shots!”

    The changed files made it through and the version number changed, but the files in assets did not transfer. Still not there. Also, strangely, in the screenshots tab of the plugin the plugin description is there.

    Is there a way to just upload the assets folder?

    #173371
    Robkk
    Moderator

    Here is some CSS that could do the same thing. Add the css styles to your child theme style css or insert the code in a plugin that can hold custom css styles.

    .bbpress .header-holder, 
    .page-template-bbpress .header-holder {
      display: none;
    }
    tech55541
    Participant

    Hello,
    I am starting a new thread because all the searches I found come up 1-5 years old and I do not trust some of the code when I do not know how to read it very well.

    I would like to allow participants to be able to trash (not delete) their replies and posts if they are still allowed to edit them based on the edit time provided in BBPress settings. Can you please give me some code to achieve this?

    Thanks.

    #173366
    Robin W
    Moderator

    Stewart,

    That’ll be in your header.php, and you’ll need to find the part that says

    <div class="header-area">
    through to
    </div>
    

    and wrap it in

    <?php if (!=bbpress()) : ?>
    <div class="header-area">
    through to
    </div>
    <?php endif; ?>
    
    

    so it will display if it is not a bbpress page

Viewing 25 results - 6,651 through 6,675 (of 32,519 total)
Skip to toolbar