Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,576 through 9,600 (of 32,519 total)
  • Author
    Search Results
  • #157895
    Stagger Lee
    Participant

    Try to play with this in functions.php:
    For some buttons you will need to borrow them from TinyMCE advanced plugin and put in core folder, they dont come in the core. (emoticons, and some else, called “plugins”)

    function bbp_enable_visual_editor( $buttons = array() ) {
    	
    	$buttons['tinymce'] = array( 
    	'toolbar1' =>'bold, italic, underline, strikethrough, blockquote, alignleft, aligncenter, alignright, alignjustify, justifyfull, bullist, numlist, outdent, indent, cut, copy, paste, undo, redo, link, unlink, table, fullscreen, image, media, cleanup, help, code, hr, removeformat, sub, sup, forecolor, forecolorpicker, backcolor, backcolorpicker, charmap, visualaid, anchor, newdocument, pastetext, separator, wp_adv,wptadv,media,image',
        'toolbar2' => 'pastetext, pasteword, selectall, formatselect, fontselect, fontsizeselect, styleselect, strikethrough, outdent, indent, pastetext, removeformat, charmap, wp_more, emoticons, forecolor, wp_help,media,image', // 2nd row, if needed
        'toolbar3' => 'pastetext,pasteword,selectall,paste_as_text,preprocess,paste,media,image', // 3rd row, if needed
        'toolbar4' => 'media,image', // 4th row, if needed 
    	'plugins'  => 'anchor, code, insertdatetime, nonbreaking, print, searchreplace, table, visualblocks, visualchars, emoticons, advlist,wordpress,wplink, paste,fullscreen',
    		   ); // 4th row, if needed 
        $buttons['quicktags'] = array ('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');
        return $buttons;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    add_filter('mce_buttons', 'bbp_enable_visual_editor');
    
    #157889

    In reply to: Add forum roles

    joop.stringer
    Participant

    Hey guys,

    Can you please explain me where to put the functions.php file ?
    If I put it in the child theme directory,my whole site goes blank …

    
    <?php
    /**
     * Functions .. additional to all the programs
     *
     * @package WordPress
     * @subpackage Twenty_Fourteen
     * @since Twenty Fourteen 1.0
     */
    
    function add_custom_role( $bbp_roles ) {
    
    	$bbp_roles['DDC Member'] = array(
    	'name' => 'DDC Member',
    	'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants );
    
    	$bbp_roles['Forumlid'] = array(
    	'name' => 'Forumlid',
    	'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants );
    
    	$bbp_roles['DDC Bestuur'] = array(
    	'name' => 'DDC Bestuur',
    	'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // i just want them to have the same capabilities as participants ); 
    
    	return $bbp_roles;
    }
    
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
    
    ?>
    
    Rosa Parker
    Participant

    This is my website: http://ecoperate.com, WordPress version is 4.0.1 and bbPress version is 2.5.4.

    I have two forum groups running on my website (‘Opportunities’ and ‘Forum’); both of them highlight a different item in the menu when they’re active. Now, what I can’t manage to do is highlighting the respective menu items in the forum topics. At least not in a way they can tell the parent forums apart.

    This works perfectly:

    .single-topic .genesis-nav-menu .menu-item-71 > a

    With the exception that only ONE of the menu-items is highlighted for every single topic (71 refers to menu item ‘Opportunities’). What I want to achieve is differentiation, by somehow linking the single-topics to the right parent forum. How can I do this?

    Any help would be greatly appreciated! 🙂

    Thanks,

    Rosa

    #157875
    Robin W
    Moderator

    ok, at least we know you’ve got the right file !

    Try the following

    delete all the content from wp-content/themes/twentyeleven/bbpress/content-single-forum.php

    and then paste the following in

    
    <?php
    
    /**
     * Single Forum Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <div id="bbpress-forums">
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php bbp_forum_subscription_link(); ?>
    
    	<?php do_action( 'bbp_template_before_single_forum' ); ?>
    
    	<?php if ( post_password_required() ) : ?>
    
    		<?php bbp_get_template_part( 'form', 'protected' ); ?>
    
    	<?php else : ?>
    
    		<?php bbp_single_forum_description(); ?>
    
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>
    
    		<?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    		<?php elseif ( !bbp_is_forum_category() ) : ?>
    
    			<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    		<?php endif; ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_single_forum' ); ?>
    
    </div>
    

    save and then try it.

    #157864
    Haris Zulfiqar
    Participant

    <div class="support-topics">[bbp-single-forum id=383269]</div>

    The above shortcode only works in http mode and not https mode. It stops the entire page content from rendering in SSL mode only.

    Nope, this is not an HTML or CSS issue.

    Any ideas?

    #157857
    Robin W
    Moderator

    see

    https://codex.wordpress.org/Class_Reference/WP_Query

    and look at the heading

    Order & Orderby Parameters

    my guess would be

    ‘orderby’ => array( ‘meta_value_num’ => ‘DESC’, ‘date’ => ‘desc’ ),

    `

    the date is the date of the post ie topic

    #157847
    Robin W
    Moderator

    ok, no problem, I can’t judge how technical people are 🙂

    You can do this in your main theme, but you would do better to create a child theme

    Don’t be intimidated, the following should explain

    Functions files and child themes – explained !

    when you get to

    What is FTP and how do I access it?

    To access your files, you’ll need an FTP client. Some host providers do with within their administration area, check with your host provider if in doubt

    I’m pretty sure form memory that hostgator has an area that does that called c-panel, but check with them if in doubt

    #157810
    Robin W
    Moderator

    and since bbp_reply_count is in the metadata, you’d need to refer to that

    see

    https://codex.wordpress.org/Class_Reference/WP_Query

    so something like

    add_action( 'bbp_init', 'view_twentyplus_posts_init' );
    
    function view_twentyplus_posts_init() 
    {
    		
    	$args  = array( 
    
    	 'meta_key'   => '_bbp_reply_count' ,
              'orderby'  => array( 'meta_value_num' => 'DESC', 'title' => 'ASC' ),
              'meta_query' => array(
    		         array(
    			'key'     => '_bbp_reply_count' ,
    			'value'   => '19',
    			'compare' => '>',
    		),
    
    	);
    
    );
    
    	
    	bbp_register_view( 'twentyplus_posts', __('Popular Posts', 'twentyplus'), $args, false );
    	
    }
    
    
    #157800
    a298e
    Participant

    I could solve this by adding following code to function.php.

    add_filter( ‘bbp_get_the_content’, ‘amend_new_topic’, 10, 3);

    Function amend_new_topic ($output, $args, $post_content) {
    if ($args[‘context’] == ‘topic’ && $post_content == ”) $output=str_replace(‘></textarea>’, ‘>question1 question2 question3</textarea>’,$output) ;
    return $output ;
    }

    Thanks,

    #157766
    Robin W
    Moderator

    your code says

    '_bbp_reply_count' => '19'

    shouldn’t that be

    '_bbp_reply_count' => '>19'

    #157764
    Twist360
    Participant

    Sadly not,

    add_action( 'bbp_init', 'view_twentyplus_posts_init' );
    
    function view_twentyplus_posts_init() 
    {
    	//$args = array( '_bbp_topic_reply_count' => '>20' );
    	
    	$args  = array( 
    	 '_bbp_reply_count' => '19'
    	);
    	
    	bbp_register_view( 'twentyplus_posts', __('Popular Posts', 'twentyplus'), $args, false );
    	
    }

    Shows me posts with no responses 🙁

    #157763

    Topic: Import Forums

    in forum Troubleshooting
    Springgg
    Participant

    Maybe I’m blind but …
    I’ve just installed bbPress plugin to my WP, with the idea to import Mingle forums but “Getting There” is not getting me anywhere as there is no Import Forums tab.
    The only tabs there are All Forums and New Forum
    My Dashboard Printscreen
    Am I in the wrong place or…?

    Help please! 🙁

    #157755

    In reply to: User role upgrade

    Robin W
    Moderator

    ok, getting there, but a solution brief would be good. ie a long description of exactly what you want.

    If it’s easy, I’ll drop some code

    If not, I might look at it as a project

    #157748
    Martyn Chamberlin
    Participant

    Hi Robin,

    Okay, I’m just now realizing that we have two problems going on here then.

    1. Problem #1 was a universal to bbPress problem, and your code above fixes that.

    2. Problem #2 is the fact that at http://thewritepractice.com/bw, the forum does not realize that you are the author of the topic you’re posting. There is no Edit button in the in-box area. Only when I enable “Edit others topics” for Participants via the bbPress Advanced Capabilities plugin do you then see the Edit link in the in-box area.

    Any ideas on how we can fix this problem, and what might be causing it?

    #157734
    Robin W
    Moderator

    ok,

    create a directory on your theme called ‘bbpress’
    ie wp-content/%your-theme-name%/bbpress
    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/%your-theme-name%/bbpress/content-single-forum.php
    bbPress will now use this template instead of the original

    then change lines

    <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    <?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    <?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    <?php elseif ( !bbp_is_forum_category() ) : ?>
    
    <?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    <?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    <?php endif; ?>
    

    to

    <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    <?php bbp_get_template_part( 'form',       'topic'     ); ?>
    			
    <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    <?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    <?php elseif ( !bbp_is_forum_category() ) : ?>
    
    			
    <?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    <?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    <?php endif; ?>

    and save

    that should do it

    #157721
    Robin W
    Moderator

    ok, the following code removes the edit for bbpress, but leaves it for normal wordpress pages

    function wpse_remove_edit_post_link( $link ) {
    	if (is_bbpress()) return '' ;
    	else return $link ;
    	}
    add_filter('edit_post_link', 'wpse_remove_edit_post_link');
    

    The users will still be able to edit their topics and replies via the in-box edit buttons

    #157711
    Martyn Chamberlin
    Participant

    Wow. Crazy that nobody has ever tried to use that feature before!

    Here’s the interesting thing though. WordPress.org’s support forum is (I’m 99% sure) built in bbPress and it does successfully allow you to edit topics that you’ve posted. The interface you are sent to when editing your topic does not reside inside the WordPress admin area. Rather it is right there on the publicly facing page.

    I wonder how they are doing that?

    Another interesting wrinkle in this whole thing is that according to the bbPress User Roles and Capabilities, participants should be able to edit their own topics.

    #157710
    Manny Rodrigues
    Participant

    I too had this issue and found countless other posts dated many years ago with no solution. I am using bbpress v2.5.4 and buddypress v2.1.1 on WordPress v4.1. I “resolved” this by editing my functions.php file within the bbpress plugin directory and replacing any character values with a blank. Good enough for me. This “solution” IS NOT RECOMMENDED as any update to bbpress is more than likely to overwrite it. Unless you don’t mind going back in and remembering to re-hack it after each update. No doubt it can be done better. The client just requested I get rid of the code values. Without further to do…

    GoTo: yoursite\wp-content\plugins\bbpress\includes\common\functions.php

    Between Lines 1090 and 1091 Add:

    
    $search_bbpress_titles = array("&# 039;", "&am p;", "&#82 11;", "&qu ot;"); // ' & - "
    $topic_title = str_replace($search_bbpress_titles, '', $topic_title);
    

    Then add the same two lines further down between Lines 1233 and 1234.

    NOTE: You will have to remove the spaces from the $search_bbpress_titles array line as I was unable to post without it parsing that line. Don’t know the coding on this form to post properly. Email me if you need the code.

    Looking forward to any other helpful input. No need to remind me how better you are at coding. 🙂

    #157703

    In reply to: PLEASE HELP!

    Seo45
    Participant

    No, I didn’t actually put the words “the color you see.” I don’t have the code anymore because I deleted it, so I’m not sure of the exact color I used, but it’s the one that it is now because it won’t go back to the original color.

    Nav bar is what I mean. It’s just the background color of the whole site. Underneath the black bar, it’s a light tan. Somewhat the same color as this site here. When you click on one of the links, that color gets darker. Here are 2 links to the different colors I’m talking about. Please don’t take the arrows as being rude. I just want to make sure you see what I mean.

    http://thevrlife.com/wp-content/uploads/2015/02/color.png

    http://thevrlife.com/wp-content/uploads/2015/02/color2.png

    #157701

    In reply to: PLEASE HELP!

    Robin W
    Moderator

    did you actually paste this line

    background-color: “the color you see”!Important;

    ie the real words “the color you see”

    This would be ignored as it’s not proper code

    And if you put this into your child theme, and you’re no longer using your child theme, then it wouldn’t matter anyway.

    And if you go to the forum, the background of the actual site under the top nah bar is a light tan. Then if you click on the test forum to go into it (though there aren’t any topics), you will notice it gets darker.

    Not sure what ‘the top nah bar ‘ if you mean nav, then I can’t see any tan in my browser, or anything going darker?????

    Put an image on photobucket or similar please

    #157699

    In reply to: PLEASE HELP!

    Seo45
    Participant

    Sorry u might be confusing. There’s 2 different backgrounds. The one that I’m talking about now is the actual background of the tables. The even and odd of the forum. I changed it by putting this in my child theme:

    #bbpress-forums div.odd,
    #bbpress-forums ul.odd {
    background-color: “the color you see”!Important;
    }
    #bbpress-forums div.even,
    #bbpress-forums ul.even {
    background-color:” the color you see”!important;
    }

    I then changed the parts that affect the actual theme through theme options. After doing this, I noticed stuff wasn’t changing back once I put it back to the default color. I then tried changing the code above and it didn’t work anymore. Then I even deleted the code, yet it still didn’t change back to normal.

    The original background was dark I believe. Can’t remember for sure. But now it’s white and a tan, which I set with the code above, but I can’t change it back.

    #157694
    Twist360
    Participant

    Thats awesome, you are right, I also needed to make

    add_action( 'bb_init', 'view_twentyplus_posts_init' );

    become

    add_action( 'bbp_init', 'view_twentyplus_posts_init' );

    Need to play a little more as its not showing what I was expecting, but at least it’s showing something 🙂

    #157688
    Robin W
    Moderator

    just add a line

    add_filter( 'bbp_get_topic_pagination_count', 'hide_topic_display' );
    

    so you end up with

    Function hide_topic_display ($retstr){
    	$retstr = '' ;
    	return $retstr ;
    }
    	
    add_filter( 'bbp_get_forum_pagination_count', 'hide_topic_display' );
    add_filter( 'bbp_get_topic_pagination_count', 'hide_topic_display' );
    
    

    That should work !

    #157686
    Twist360
    Participant

    Hi Guys,

    I am trying to have a page in WordPress which shows two sections:

    1) posts with 20 or more replies
    2) posts with 19 or less replies

    I have created a page with the following shortcodes:

    [bbp-single-view id="twentyplus_posts"]
    [bbp-single-view id="lesstwenty_posts"]

    I have added the following into my themes functions.php file:

    
    // Add Custom View - Forum Home
    
    add_action( 'bb_init', 'view_twentyplus_posts_init' );
    
    function view_twentyplus_posts_init() 
    {
    	$args = array( 'post_count' => '>19' );
    	bb_register_view( 'twentyplus_posts', __('Popular Posts', 'example'), $args, false );
    }
    
    add_action( 'bb_init', 'view_lesstwenty_posts_init' );
    
    function view_lesstwenty_posts_init() 
    {
    	$args = array( 'post_count' => '<20' );
    	bb_register_view( 'lesstwenty_posts', __('Forum Posts', 'example'), $args, false );
    }

    However all I get in response is:

    Oh bother! No topics were found here!

    Oh bother! No topics were found here!

    Any idea what I am doing wrong here?

    #157684
    Robin W
    Moderator

    For those who have been asking a new plugin which hopefully will help

    https://wordpress.org/plugins/bbp-style-pack/

    Changing style items – now in this plugin so no need to create child themes and post complicated code into style sheets

    Changing how the forum looks, the most asked for items, such as vertical sub forums, hiding counts, adding ‘create new topic’ links, removing ‘private’ prefix, adding forum descriptions, changing breadcrumbs and more

    Login – create simple menu items to help with logging in, registration and changing profiles

    Shortcodes – 3 useful new shortcodes to help your display

    Feedback both positive and ‘needs improvement’ welcomed !

Viewing 25 results - 9,576 through 9,600 (of 32,519 total)
Skip to toolbar