Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,676 through 9,700 (of 32,511 total)
  • Author
    Search Results
  • #157160
    Robin W
    Moderator

    Do you know what the code is that you would add at that location?

    #157155

    In reply to: BBpress width

    Robin W
    Moderator

    ok, gentle response !!

    your forum is sitting within a class of .entry-content which is set to max-width: 474px;

    so you need to add

    .entry-content {
      max-width: 100% !important;
    }
    

    to your theme style.css at the end

    Strictly speaking you should add this to a child theme

    Functions files and child themes – explained !

    but if you add it to your main theme, juts keep a note of it, as you will need to re-add it should your theme be updated

    Come back if anything not clear, and I’ll help further !

    #157146
    UgoDimma
    Participant

    I want to add ShareThis sharing button at the top and bottom of every posts, but I dont know which file to edit and where exactly to add the code. Please someone guide me through. Am using bbpress 2.5.4 wordpress 4.1

    you can have a look at this screenshot to understand what I really need,
    http://s1382.photobucket.com/albums/ah248agbams/?action=view&current=sharethis_zps1df4998b.png

    #157136

    In reply to: BreadCrumb

    Robin W
    Moderator

    ok, I’m planning to write some code for another purpose that will be using this function in the next few days, when I do I’ll take a look

    #157135

    Hi there,

    I’m looking for an option to hold new topics by non-admin users in moderation for approval before they are visible. I’ve tried looking at this plugin: https://wordpress.org/plugins/bbpressmoderation/ but it deals with topics and replies together- you have to moderate both or not moderate both. I’m not interested in moderating replies, just topic starters.
    Could anybody by any chance suggest a different plugin, a code snippet to use etc. to work around this issue?
    (I’m running the latest versions on WordPress, BuddyPress and bbPress).
    Thank you very much!

    #157132
    mvaneijgen
    Participant

    I had to create several new users but I could not just copied and paste the code again so I modified the code a bit

    
    //code to add expert role 
    
    function add_expert_role( $bbp_roles )
    {
    	/* Add a role called expert */
    	$bbp_roles['bbp_expert'] = array(
    		'name' => 'expert',
    		'capabilities' => custom_capabilities_expert( 'bbp_expert' )
    		);
    	return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_expert_role', 1 );
    
    function expert_role_caps_filter( $caps, $role )
    {
    	/* Only filter for roles we are interested in! */
    	if( $role == 'bbp_expert' )
    		$caps = custom_capabilities_expert( $role );
     
    	return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'expert_role_caps_filter', 10, 2 );
    
    function custom_capabilities_expert( $role )
    {
    	switch ( $role )
    	{
    		 
    		/* Capabilities for 'expert' role */
    		case 'bbp_expert':
    			return array(
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    				'moderate'              => false,
    				'throttle'              => false,
    				'view_trash'            => false,
     
    				// Forum caps
    				'publish_forums'        => false,
    				'edit_forums'           => false,
    				'edit_others_forums'    => false,
    				'delete_forums'         => false,
    				'delete_others_forums'  => false,
    				'read_private_forums'   => true,
    				'read_hidden_forums'    => false,
     
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    				'edit_others_topics'    => false,
    				'delete_topics'         => false,
    				'delete_others_topics'  => false,
    				'read_private_topics'   => true,
     
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'edit_others_replies'   => false,
    				'delete_replies'        => false,
    				'delete_others_replies' => false,
    				'read_private_replies'  => true,
     
    				// Topic tag caps
    				'manage_topic_tags'     => false,
    				'edit_topic_tags'       => false,
    				'delete_topic_tags'     => false,
    				'assign_topic_tags'     => true,
    			);
    			break;
     
    		default :
    			return $role;
    	}
    }

    This creates the role Expert. I put this in my functions.php of my child-theme

    #157131
    Stagger Lee
    Participant

    I do it with this snippet. For WordPress and bbPress together. Local links are opened normally, only extern are target blank. Dont forget to change your domain line.

    // Make URL Clickable In WordPress, bbPress (plus target=”_blank”)
    add_filter( 'the_content', 'make_clickable');
    
    function autoblank($text) {
    $myurl = 'http://your-domain.com';
    $external = str_replace('href=', 'target="_blank" href=', $text);
    $external = str_replace('target="_blank" href="'.$myurl, 'href="'.$myurl, $external);
    $external = str_replace('target="_blank" href="#', 'href="#', $external);
    $external = str_replace('target = "_blank">', '>', $external);
    return $external;
    }
    add_filter('the_content', 'autoblank');
    add_filter('bbp_get_topic_content', 'autoblank',255);
    add_filter('bbp_get_reply_content', 'autoblank',255);

    Remove nofollow if you need to !

    function mtn_weekly_fix_rel_follow( $content ) {
        // Find rel="nofollow", replace with empty space.
        $content = preg_replace( '/rel="nofollow"/', ' ', $content);
        return $content;
    }
    add_filter( 'the_content', 'mtn_weekly_fix_rel_follow', 20 );
    add_filter('bbp_get_topic_content', 'mtn_weekly_fix_rel_follow',255);
    add_filter('bbp_get_reply_content', 'mtn_weekly_fix_rel_follow',255);
    
    Robin W
    Moderator

    wherever it says (think it’s more than once)

    'type' => 'both', 'size' => 14 ) );
    

    change to

    'type' => 'name', 'size' => 14 ) );
    
    Novadrake1111
    Participant

    I am using a wordpress skin that integrates BBPress very nicely. One thing I am looking to do, however is make the bbpress forums have a hierarchy like any other software out there currently. I am not that amazing at coding and would appreciate if someone could explain in an easy to understand way. If it’s something that I would have to code completely over, i’d be willing to pay someone to help me code that.

    Thank You

    #157099

    In reply to: Delete Prive

    Robin W
    Moderator

    add the following to your functions file

    add_filter('private_title_format', 'pg_remove_private_title');
    
    function pg_remove_private_title($title) {
    		return '%s';
    	}
    

    Functions files and child themes – explained !

    van24
    Participant

    That worked perfectly! And the code you mentioned earlier in the thread is perfect. Thanks for your help 🙂

    Robin W
    Moderator

    You’ll need to register it for it to go live, try the following in your functions file

    add_action( 'widgets_init', function(){
         register_widget( 'BBP_Topics_Widget2');
    });
    
    Robin W
    Moderator

    I copied the entire Recent Topics widget code into my functions.php

    You need to copy and rename it.

    Then you use this new named widget, not the old one, so need to cal the new name in your sidebar.

    van24
    Participant

    Hi Robin

    I’m trying to get the same functionality that SeeingBlue is looking for. I copied the entire Recent Topics widget code into my functions.php, and I added your code in the correct place, but the widget is still behaving exactly the same.. Any idea what else I need to do?

    Thanks
    Van

    #157068
    Robin W
    Moderator
    #157058

    In reply to: Username display issue

    Robkk
    Moderator

    it could be just making the font-size smaller.

    copy this CSS anywhere you can put custom CSS

    #bbpress-forums div.bbp-forum-author a.bbp-author-name, 
    #bbpress-forums div.bbp-topic-author a.bbp-author-name, 
    #bbpress-forums div.bbp-reply-author a.bbp-author-name {
    font-size:12px;
    }
    #157054
    Robkk
    Moderator

    @discdemo

    remove Dougs code and see if just using this will fix it. it does the same thing.

    https://wordpress.org/plugins/bbpress-enable-tinymce-visual-tab/

    also see if deactivating wp-edit will fix the problem , i tried it awhile ago with the visual editor code and it was kind of buggy.

    #157050
    Robkk
    Moderator

    if you haven’t already copy all of your bbPress templates to a folder called bbpress in your child theme

    follow this codex guide.

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

    and also check if its a theme issue , switch to a default theme like twentytwelve and see if the issue is still there or not.

    #157044
    discdemo
    Participant

    @dougismith I’m getting this when I try your suggested code.
    Any ideas, anyone? This was placed where the child theme for buddy press
    states to, in the functions.php. (I’ using a theme called BuddyBoss, fyi)

    Thanks, all.

    Parse error: syntax error, unexpected ‘&’, expecting ‘]’ in /home/agonyofd/public_html/wp-content/themes/buddyboss-child/functions.php on line 60

    jz

    #157031

    In reply to: Group Forums

    tharsheblows
    Participant

    Ah ha! I see what you mean (maybe). So something in content-single-forum.php like this?

    <?php 
       if(  bbp_is_forum_group_forum( bbp_get_forum_id() )){
          bbp_get_template_part( 'form',       'topic'     );
       }else{
          echo '<a href="/">You could link to your form or whatever else here.</a>';  
       } 
    ?>

    rather than what’s there now:
    <?php bbp_get_template_part( 'form', 'topic' ); ?>

    Then you could use the shortcode [bbp-topic-form] on a new page and link to that page.

    Touda
    Participant

    I made another test trying to create a new topic (thread) from the form under the listing given by [bbp-singl-forum id=6] and it give me back the following error:

    ERROR: No tienes permisos para crear nuevos hilos.

    Which is Spanish for You do not have permission to create new topics.

    Touda
    Participant

    After having installed, configured and started some forums and subforums with the initial threads (topics), suddenly I found some issues, maybe related with some new plugins I’ve been installing on the same site:
    – Forums URLs give 404 errors
    – Topics URLs are found OK
    – No reply is possible to those topics even when logged as Admin (Keymaster). BBPress shows this error:

    ERROR: You do not have permission to reply.

    ERROR: This forum is private and you do not have the capability to read or create new replies in it.

    When testing shortcodes on a test page it gives the following results:

    [bbp-forum-index] -> No forum is listed

    [bbp-single-forum id=6] -> Forum is shown with its topics

    [bbp-topic-index] -> Topics are listed OK

    Any idea?

    Thanks in advance for any help.

    #157023
    Nicolas Korobochkin
    Participant

    Fix it. Just add global $active_signup; in selena_network_signup_main. Already update this file on gists.github.

    #157017
    palmdoc
    Participant

    This works for me :

    1) Add this to function.php in your child theme

    via http://bavotasan.com/2014/add-media-upload-button-to-bbpress/

    Open up your functions.php file and add the following snippet to get it working:

    add_filter( 'bbp_after_get_the_content_parse_args', 'bavotasan_bbpress_upload_media' );
    /**
     * Allow upload media in bbPress
     *
     * This function is attached to the 'bbp_after_get_the_content_parse_args' filter hook.
     */
    function bavotasan_bbpress_upload_media( $args ) {
    	$args['media_buttons'] = true;
    
    	return $args;
    }
    

    So now you have the Add Media button in the posting

    2) What you need now is to fine tune the user capabilities so that not only administrators but normal users can upload media direct to the form post using the Add Media button

    I am using the Capability Manager Enhanced plugin

    https://wordpress.org/plugins/capability-manager-enhanced

    I guess you could use a Custom user type (e.g. clone the normal participants) to experiment. Later on you could edit all your users and convert them to this Custom user type

    Check the ability to:

    a) Upload files
    b) Unfiltered HTML

    for this Custom user type

    I guess it comes with risks but it has the benefits of direct Media upload to the bbPress forum

    It’s not only images but other media e.g. PDF (which works nicely with thhe Google Doc Embedder Plugin

    #157011
    jamesdoesdesign
    Participant

    I know this is a tad bit old however I happened to stumble on this post while I was looking for a way to increase both the page to 100 posts and the parent page to show all 100 posts as well. The solution above adding to the functions page did not work for me even upon changing it to the proper code.

    I did however find the same solution as jameswordpress did but there are multiple lines.
    to edit so that both the parent forum and the selected forum page to show more than 50 forums.

    To do this edit template.php located in:
    /bbpress/includes/forums/template.php

    Change line 135:
    'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),

    to:
    'posts_per_page' => get_option( '_bbp_forums_per_page', 100 ),

    ———-

    Also changing line 708 should effect the parent page (at least it did for myself):
    'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),

    to:
    'posts_per_page' => get_option( '_bbp_forums_per_page', 100 ),

    You can change the value of 50 to whatever you desire.

Viewing 25 results - 9,676 through 9,700 (of 32,511 total)
Skip to toolbar