Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,526 through 3,550 (of 32,481 total)
  • Author
    Search Results
  • #204267
    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    add_filter( 'bbp_get_replies_per_page', 'rew_replies');
    
    function rew_replies () {
    $replies = 5 ;
    return $replies ;
    }
    #204260
    demonboy
    Participant

    Hi,

    Strange request but I would like to hide a forum completely when the user is logged in. This is because I’m using this forum as an info page for new visitors. Once a user is registered and logged in, they don’t need to see the forum, so I’d like to remove the entire < ul >. I’m hoping this is a simple addition to my functions.php file, something along the lines of:

    if ( bbp_is_user_logged_in() ) {
       echo "<some css that did ul.bbp-forum-40250 {display:none;}
    }

    Except I know that’s probably not the best way to achieve this. What would be the best way to hide the forum to logged in users?

    Thanks.

    #204093
    demonboy
    Participant

    Hi,

    I have a gallery I would like to add either within the forum description or within a topic but bbpress is not parsing the shortcode. It is not a bbpress shortcode, it comes from a gallery plugin.

    How do I enable parsing of other shortcodes within bbpress?

    Thanks!

    #203942
    kjvhout
    Participant

    Hi, tanks for your response. I already found this code on the internet, but it didn’t seem to do anything.

    #203931
    StormD
    Participant

    Hi. Can anyone please help me with the code to do this:

    change this
    [bbp-single-reply id=$reply_id]

    to this
    [bbp-single-reply id=$topic_id]

    or anything that will basically do the same thing. Perhaps just the code to direct a reply form to a topic?

    thanks in advance

    #203895
    davec14
    Participant

    Good Afternoon,

    I am currently having an issue with getting my template overrides to work on bbpress pages, like forums and questions( indlucing shortcodes). I have the files located in /wp-content/themes/mytheme/bbpress/ but they are not working. Is there something I have done wrong? Or something I need to do? I am trying to edit loop-forums.php and others.

    Many thanks in advance for any help or advice,

    Kind regards,

    Dave

    #203893
    Robin W
    Moderator

    there is a fuction

    bbp_delete_topic function that you can substitute which I have not tested

    #203892
    Robin W
    Moderator

    this will close topics with no activity in the last 10 days

    
    /*
    Plugin Name: BBPress Close Old Posts
    Description: Close BBPress 2.0+ posts that haven't been updated in X days. 
    Author: Raygun
    Version: 0.1
    Author URI: http://madebyraygun.com
    
    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    */ 
    
    register_activation_hook(__FILE__, 'bbpress_topic_scheduler');
    
    add_action('bbpress_daily_event', 'bbpress_close_old_topics');
    
    function bbpress_topic_scheduler() {
     wp_schedule_event(time(), 'daily', 'bbpress_daily_event');
    }
    
    function bbpress_close_old_topics() {
    	// Auto close old topics
    	$topics_query = array(
    		'author' => 0,
    		'show_stickies' => false,
    		'parent_forum' => 'any',
    		'post_status' => 'publish',
    		'posts_per_page' => -1
    	);
    	if ( bbp_has_topics( $topics_query ) )
    		while( bbp_topics() ) {
    			bbp_the_topic();
    			$topic_id = bbp_get_topic_id();
    			$last_active = strtotime( get_post_meta( $topic_id, '_bbp_last_active_time', true ) );
    			if ($last_active < strtotime( '-10 days') )
    				bbp_close_topic( $topic_id );
    		}
    }
    ?>
    #203855
    StormD
    Participant

    Robin, I’m closing the site again to try to restore some of what was deleted.

    I think I found a solution. I simply created another page and used elementor and bsp shortcodes. Whichs seem to work fine. The Archives piece has disappeared and I can style with your shortcodes 🙂

    In the case of categories, having elementor settings post types checked for posts seems to take away any ability to do anything with categories. I suppose that could have been the case with the archives bit, as well. but that really doesn’t make sense sense WP was completely deleted, including elementor. Perhaps it’s in phpMyAdmin. idk.

    Anyway, we’re all good here. Just one question. Do I now need to change the root slug?

    Thank you!
    Storm

    #203852
    StormD
    Participant

    at this point, I am using bsp shortcodes…some work as stated..some don’t..so I’m just at a loss

    #203846
    StormD
    Participant

    wow well that’s stupidly embarrassing. This is what I was expecting:

    https://buddypress.org/wp-content/uploads/53/2013/11/forum1.jpg

    taken from here:

    Step by step guide to setting up a bbPress forum – Part 1

    Any advice on the archives heading?

    Thanks again!

    #203834
    StormD
    Participant

    my site is deleted. I had bluehost absolutely wipe out WP and I started out adding bbpress and trying this again. I really haven’t yet added anything else back except for elementor. Am I misunderstanding thinking that [bbp-forum-index] should return a forum name and then have topics listed underneath and then the next forum and so on? If so, disregard and tell me I’m just silly please. Anyway, I threw something up and created a gyazo of what I think you might be wanting to see. But, if you need to get in there I can create some credentials for you if you want to message privately.

    So, left to right. Topics…I created a couple in topics and one by going to the page and opening the forum. Next, the page created with just the shortcode. I didn’t even use elementor. Just straight to add new page and shortcode using the name in the root. The last one, I opened the site and used an incognito window to view the page.

    As you can see, it’s like it’s calling up archives. Looking back, I didn’t mention that before. That was really dumb. It’s been doing that all along. After deactivating all plugins, this is what made me believe I actually needed to reinstall WP. Honestly, this index thing is not my actual issue. LOL maybe we can address that one later? But bc of the archives thing, I am afraid to move forward.

    Hopefully, now that you have the whole story, you will recognize my error and be able to just say comment this code out with your child’s functions.php or add that to some other file or whatever. And all will be well 🙂

    Thank you so much, Robin. I look forward to hearing from you.
    Storm

    https://gyazo.com/ab8f8fd010ba5967cce876c547b971b4

    #203799
    StormD
    Participant

    Hi. Forgive me. I’m new to all of this…trying but new. My frontpage containing [bbp-forum-index] is not working. It shows the forums but not the topics.

    I did try using Topics for Posts but decided I couldn’t see the benefit. So, at this point, I have tried the following things:
    checked permalinks
    reset forum root should show to topics by freshness
    I have repaired and reset bbpress
    And, at that point, I rolled the entire thing back with backup to before the bbpress install. And did not update any plugins. Also, though I have bbpress styling code thingies I had intended to use, I had not gotten past adding a bbpress folder to my theme’s child.

    At this point, I am deactivating plugins but am not confident that will solve it. But if it does, I will come right back and try to delete this or just plain apologize.

    Any help at all would be greatly appreciated.

    ttranvnu
    Participant

    I checked the database posts table via phpmyadmin and confirmed that replies posts did not come over to bbpress. Is there a way I can fix this manually by running some manual sql code?

    I’m using latest wordpress just downloaded today, and latest version of bbpress (bbPress 2.5.14).
    During the conversion I only get the following error which I don’t think tied to the replies posts not coming over.

    Repair any missing information: Continue

    WordPress database error: [Table ‘*.*_core_tags’ doesn’t exist]
    SELECT convert(core_tags.tag_meta_id USING “utf8mb4”) AS tag_meta_id,convert(core_tags.tag_text USING “utf8mb4”) AS tag_text FROM *_core_tags AS core_tags LIMIT 0, 100

    No tags to convert

    No super stickies to stick

    #203767
    Robin W
    Moderator

    Please forgive me my ignorance – don’t worry we were all there when we started !!

    bbpress uses the wordpress database and pages so is contained entirely within wordpress.

    at it’s simplest, just put a ‘custom link’ menu entry of url ‘/fourms/’ and navigation label of ‘forums’ into your menu.

    Alternately create a page with a title of say ‘forums’ and put [bbp-forum-index] in the content.

    #203765
    mattpont
    Participant

    The client I’m working for would like logged in members to be able to create forums.

    I’ve added the [bbp-forum-form] shortcode to the archive-forums.php template, and given the logged in user role the following permissions:
    – edit_forums
    – publish_forums
    – delete_forums

    However, when I login as a user in the above role, I get the “You cannot create new forums” message.

    Any ideas what is happening here please?

    #203764
    Robin W
    Moderator

    bbpress is just a plugin that sits within wordpress, so you would just install it and typically have a menu entry to

    yoursite.com/forums

    see

    Step by step guide to setting up a bbPress forum – Part 1

    #203697
    Robin W
    Moderator

    yes, in effect create the subdomain you say, and install wordpress and bbpress.

    Then you could just have a home page with the code [bbp-forum-index] in it and that is all that site would contain

    #203696
    Robin W
    Moderator

    this is a theme conflict issue, and you need to get your theme to recognise bbpress.

    Not bbpress’s fault and not your theme’s fault, both just use wordpress

    see

    Step by step guide to setting up a bbPress forum – Part 1

    section 8 on trying to get them to work together

    #203682
    meestergijs
    Participant

    Haha. This is amazing. I added the code to my php and it worked. Thanks a million. Some other experts couldn’t help me with this.

    Robin, two more questions. Related.

    Can you also tell me how I as administrator get all forums in a alphabetical order, but my students/members not? It’s totally random? How can I fix that? I think the most recent one is on top. How can I change that? I can’t seem to change to date of publication.

    And how can I get notified when some starts topic in a forum. I tried the plugin bbPress Notify Admin, but it didn’t work. Perhaps I didn’t follow the instructions correctly.

    Any help would be great. Let’s make this 3 out of 3 😉

    Gijs (Holland)

    #203680
    ryanrain
    Participant

    small tweak to not break for users with names that include spaces. the issue was not a permissions one as i posted above.

    
    /*
     * attempt to handle generic request for current user
     * https://bbpress.org/forums/topic/how-do-i-link-to-profile-page/
     *
     * if the url is passed as forums/users/current/
     * this function detects that the permalink has been set to bbp_user=current
     * and
     *  - if the user is logged on, the query is changed to the current user
     *  - if the user is not logged on, the user is redirected to login screen
     *
     */
    function ink_bbp_request_current_user( $query_vars ) {
    	if ( isset( $query_vars[ 'bbp_user' ] ) ) {
    		switch ( $query_vars[ 'bbp_user' ] ) {
    			case 'current':
    				if ( get_current_user_id() ) {
    					$query_vars[ 'bbp_user' ] = bbp_get_user_nicename(get_current_user_id());
    				} else {
    					auth_redirect();
    				}
    		}
    	}
    	return $query_vars;
    }
    
    add_filter( 'bbp_request', 'ink_bbp_request_current_user', 10, 1 );
    
    #203678
    ryanrain
    Participant

    @jonathanmoorebcs for me, your code works great for admin users, but fails for contributor role users

    lucasjbyoung
    Participant

    Hey guys

    This is probably due to my theme, but the default install of the forum at the url /forums displays the forum on a page with the title “Archives” and the layout is broken, ugly, full width etc.

    The Ugly Layout

    Following another suggestion on this forum, I created a forum holding page at the url /forum and used the shortcode [bbp-forum-index] to embed the forum in this page, and it looks great.

    The Nice Layout

    However, when any forum link is clicked, you’re taken to a page with the starting slug of /forums and the ugly layout again. How do I keep the forum within the nice page layout?

    In the Settings I have:

    Forum root: forums
    Forum prefix: unchecked
    Forum root should show: Forum Index
    Single forum slugs / Forum: forum

    If I change the forum root to /forum that overrides the custom page I set up and I’m back to the ugly layout again.

    What’s the best way around this?

    Many thanks in advance.

    #203606
    Robin W
    Moderator

    I suspect it’s related to your theme, but all I’m seeing on that link is a buddypress page.

    you can try this in your theme’s custom css, but I feel it is more related to the theme selections you are using

    .g-cols .l-content {
    	width: 100% !important;
    }
    #203597
    Robin W
    Moderator

    <a href="http://yoursite.com/forums">Words Here</a>

    in custom html widget

Viewing 25 results - 3,526 through 3,550 (of 32,481 total)
Skip to toolbar